]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
httpc: fix the stack corruption (clang sanitizer)
authorJaroslav Kysela <perex@perex.cz>
Fri, 19 Aug 2016 06:46:13 +0000 (08:46 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 19 Aug 2016 06:46:13 +0000 (08:46 +0200)
src/httpc.c

index 0c9bbcdde9bc8291b0232c6af528250314dd5200..c65baecf4818a60ff18338cf534dfe30cd871c79 100644 (file)
@@ -927,7 +927,7 @@ http_client_run0( http_client_t *hc )
       return res;
   }
 
-  buf = alloca(hc->hc_io_size);
+  buf = alloca(hc->hc_io_size + 1);
   if (!hc->hc_in_data && !hc->hc_in_rtp_data && hc->hc_rpos > 3) {
     hc->hc_rbuf[hc->hc_rpos] = '\0';
     if (hc->hc_version == RTSP_VERSION_1_0 && hc->hc_rbuf[0] == '$')