# HG changeset patch # User mstorsjo # Date 1275633312 0 # Node ID c7ddd67739a68725929065cfe8a9214ad550734f # Parent 4518f83661f4272d8157d457a3c9f7d1a16db5e0 http: Set http_code to 200 when doing a POST This avoids reading and comparing uninitialized memory. diff -r 4518f83661f4 -r c7ddd67739a6 http.c --- a/http.c Fri Jun 04 01:15:41 2010 +0000 +++ b/http.c Fri Jun 04 06:35:12 2010 +0000 @@ -291,6 +291,10 @@ if (post) { /* always use chunked encoding for upload data */ s->chunksize = 0; + /* Pretend that it did work. We didn't read any header yet, since + * we've still to send the POST data, but the code calling this + * function will check http_code after we return. */ + s->http_code = 200; return 0; }