mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-18 16:49:18 +03:00
make urldb internal parse macros less prone to control flow errors
fixes issue highlighted by coverity (CID 1361696)
This commit is contained in:
parent
ca942e9e26
commit
718da3ffff
@ -3796,7 +3796,7 @@ void urldb_load_cookies(const char *filename)
|
|||||||
if (!fp)
|
if (!fp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#define FIND_T { \
|
#define FIND_T do { \
|
||||||
for (; *p && *p != '\t'; p++) \
|
for (; *p && *p != '\t'; p++) \
|
||||||
; /* do nothing */ \
|
; /* do nothing */ \
|
||||||
if (p >= end) { \
|
if (p >= end) { \
|
||||||
@ -3804,16 +3804,16 @@ void urldb_load_cookies(const char *filename)
|
|||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
*p++ = '\0'; \
|
*p++ = '\0'; \
|
||||||
}
|
} while(0)
|
||||||
|
|
||||||
#define SKIP_T { \
|
#define SKIP_T do { \
|
||||||
for (; *p && *p == '\t'; p++) \
|
for (; *p && *p == '\t'; p++) \
|
||||||
; /* do nothing */ \
|
; /* do nothing */ \
|
||||||
if (p >= end) { \
|
if (p >= end) { \
|
||||||
LOG("Overran input"); \
|
LOG("Overran input"); \
|
||||||
continue; \
|
continue; \
|
||||||
} \
|
} \
|
||||||
}
|
} while(0)
|
||||||
|
|
||||||
while (fgets(s, sizeof s, fp)) {
|
while (fgets(s, sizeof s, fp)) {
|
||||||
char *p = s, *end = 0,
|
char *p = s, *end = 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user