dovecot-2.2: lib-http: http-client: Prevented http_client_reques...
dovecot at dovecot.org
dovecot at dovecot.org
Sun Apr 27 16:06:04 UTC 2014
details: http://hg.dovecot.org/dovecot-2.2/rev/00efbe39263f
changeset: 17278:00efbe39263f
user: Stephan Bosch <stephan at rename-it.nl>
date: Sun Apr 27 19:05:38 2014 +0300
description:
lib-http: http-client: Prevented http_client_request_continue_payload() from segfaulting when the callback sets the request pointer to NULL.
diffstat:
src/lib-http/http-client-request.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diffs (18 lines):
diff -r b0add701dcee -r 00efbe39263f src/lib-http/http-client-request.c
--- a/src/lib-http/http-client-request.c Sun Apr 27 19:05:35 2014 +0300
+++ b/src/lib-http/http-client-request.c Sun Apr 27 19:05:38 2014 +0300
@@ -524,7 +524,13 @@
}
req->payload_wait = FALSE;
- http_client_request_unref(_req);
+
+ /* callback may have messed with our pointer,
+ so unref using local variable */
+ http_client_request_unref(&req);
+ if (req == NULL)
+ *_req = NULL;
+
if (conn != NULL)
http_client_connection_unref(&conn);
More information about the dovecot-cvs
mailing list