From cf6ba06cd445f1f4554701637d5bab581acfba98 Mon Sep 17 00:00:00 2001 From: dartraiden Date: Mon, 21 Apr 2025 09:33:29 +0300 Subject: libcurl: update to 8.13.0 --- libs/libcurl/src/dynbuf.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libs/libcurl/src/dynbuf.c') diff --git a/libs/libcurl/src/dynbuf.c b/libs/libcurl/src/dynbuf.c index 2b65b76336..f756363fea 100644 --- a/libs/libcurl/src/dynbuf.c +++ b/libs/libcurl/src/dynbuf.c @@ -32,7 +32,9 @@ #define MIN_FIRST_ALLOC 32 +#ifdef DEBUGBUILD #define DYNINIT 0xbee51da /* random pattern */ +#endif /* * Init a dynbuf struct. @@ -41,6 +43,7 @@ void Curl_dyn_init(struct dynbuf *s, size_t toobig) { DEBUGASSERT(s); DEBUGASSERT(toobig); + DEBUGASSERT(toobig <= MAX_DYNBUF_SIZE); /* catch crazy mistakes */ s->bufr = NULL; s->leng = 0; s->allc = 0; @@ -57,6 +60,7 @@ void Curl_dyn_init(struct dynbuf *s, size_t toobig) void Curl_dyn_free(struct dynbuf *s) { DEBUGASSERT(s); + DEBUGASSERT(s->init == DYNINIT); Curl_safefree(s->bufr); s->leng = s->allc = 0; } @@ -181,7 +185,7 @@ CURLcode Curl_dyn_add(struct dynbuf *s, const char *str) DEBUGASSERT(s->init == DYNINIT); DEBUGASSERT(!s->leng || s->bufr); n = strlen(str); - return dyn_nappend(s, (unsigned char *)str, n); + return dyn_nappend(s, (const unsigned char *)str, n); } /* @@ -207,7 +211,7 @@ CURLcode Curl_dyn_vaddf(struct dynbuf *s, const char *fmt, va_list ap) str = vaprintf(fmt, ap); /* this allocs a new string to append */ if(str) { - CURLcode result = dyn_nappend(s, (unsigned char *)str, strlen(str)); + CURLcode result = dyn_nappend(s, (const unsigned char *)str, strlen(str)); free(str); return result; } -- cgit v1.2.3