]> granicus.if.org Git - curl/commitdiff
lib: silence null-dereference warnings
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Mon, 9 Apr 2018 13:53:12 +0000 (15:53 +0200)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Mon, 9 Apr 2018 13:54:52 +0000 (15:54 +0200)
In debug mode, MingGW-w64's GCC 7.3 issues null-dereference warnings
when dereferencing pointers after DEBUGASSERT-ing that they are not
NULL.
Fix this by removing the DEBUGASSERTs.

Suggested-by: Daniel Stenberg
Ref: https://github.com/curl/curl/pull/2463

lib/http.c
lib/strtoofft.c

index 674e49665678f05f02bf1274dc7fb69f87d40aef..ec709ff8d32ab41e5808e3597160b0cc44f84546 100644 (file)
@@ -214,8 +214,6 @@ char *Curl_copy_header_value(const char *header)
   char *value;
   size_t len;
 
-  DEBUGASSERT(header);
-
   /* Find the end of the header name */
   while(*header && (*header != ':'))
     ++header;
index 363647737f1b2fb8696842d7e1350d3ad9fb07b2..546a3ff75d6207efa11ebd48a7d0d072a501e353 100644 (file)
@@ -220,8 +220,6 @@ CURLofft curlx_strtoofft(const char *str, char **endp, int base,
   errno = 0;
   *num = 0; /* clear by default */
 
-  DEBUGASSERT(str);
-
   while(*str && ISSPACE(*str))
     str++;
   if('-' == *str) {