mirror of
https://github.com/php/php-src.git
synced 2024-12-12 19:33:31 +08:00
fix invalid read when trimming empty string
This commit is contained in:
parent
065862a750
commit
bb60122c2f
@ -107,9 +107,11 @@
|
|||||||
if (len < 1) { \
|
if (len < 1) { \
|
||||||
RETURN_VALIDATION_FAILED \
|
RETURN_VALIDATION_FAILED \
|
||||||
} \
|
} \
|
||||||
|
if (len > 0) { \
|
||||||
while (p[len-1] == ' ' || p[len-1] == '\t' || p[len-1] == '\r' || p[len-1] == '\v' || p[len-1] == '\n') { \
|
while (p[len-1] == ' ' || p[len-1] == '\t' || p[len-1] == '\r' || p[len-1] == '\v' || p[len-1] == '\n') { \
|
||||||
len--; \
|
len--; \
|
||||||
} \
|
} \
|
||||||
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define PHP_FILTER_GET_LONG_OPT(zv, opt) { \
|
#define PHP_FILTER_GET_LONG_OPT(zv, opt) { \
|
||||||
|
Loading…
Reference in New Issue
Block a user