1
0
mirror of https://github.com/php/php-src.git synced 2026-04-24 00:18:23 +02:00

Fix a possible segfault (Thanks to Sebastian for catching it)

This commit is contained in:
Sascha Schumann
2001-08-03 09:36:14 +00:00
parent 3459f05a07
commit 84aed3b718
+10 -3
View File
@@ -89,9 +89,16 @@ extern int le_fp;
efree(key); \
}
#define SEARCHCR() do { \
for (p = READPTR(sock), pe = p + MIN(TOREAD(sock), maxlen); \
*p != '\n'; ) if (++p >= pe) { p = NULL; break; } \
#define SEARCHCR() do { \
if (TOREAD(sock)) { \
for (p = READPTR(sock), pe = p + MIN(TOREAD(sock), maxlen); \
*p != '\n'; ) \
if (++p >= pe) { \
p = NULL; \
break; \
} \
} else \
p = NULL; \
} while (0)
#ifdef PHP_WIN32