]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
dynbuf: make sure Curl_dyn_tail() zero terminates
authorDaniel Stenberg <daniel@haxx.se>
Sun, 13 Sep 2020 21:08:45 +0000 (23:08 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 14 Sep 2020 06:29:46 +0000 (08:29 +0200)
Closes #5959

lib/dynbuf.c

index 38d370b078d4513c6a8f2e80dccd52714d44fa5f..265a769e871dedc63a750cc622d152b646c0fc54 100644 (file)
@@ -143,6 +143,7 @@ CURLcode Curl_dyn_tail(struct dynbuf *s, size_t trail)
   else {
     memmove(&s->bufr[0], &s->bufr[s->leng - trail], trail);
     s->leng = trail;
+    s->bufr[s->leng] = 0;
   }
   return CURLE_OK;