http: ignore empty lines before HTTP response
[project/uclient.git] / uclient-http.c
index 47c890fca689cd0457108725b5ac91098d59142a..4633956e63519e637749e9a82efb195f34eb6a4d 100644 (file)
@@ -552,6 +552,9 @@ static void uclient_parse_http_line(struct uclient_http *uh, char *data)
        if (uh->state == HTTP_STATE_REQUEST_DONE) {
                char *code;
 
+               if (!strlen(data))
+                       return;
+
                /* HTTP/1.1 */
                strsep(&data, " ");