mirror of
https://github.com/php/php-src.git
synced 2024-09-28 05:16:12 +00:00
fix #38721 (date_parse() invalid read)
This commit is contained in:
parent
49f7759c27
commit
cb04bb6a4f
@ -22140,13 +22140,15 @@ timelib_time* timelib_strtotime(char *s, int len, struct timelib_error_container
|
|||||||
in.errors->error_count = 0;
|
in.errors->error_count = 0;
|
||||||
in.errors->error_messages = NULL;
|
in.errors->error_messages = NULL;
|
||||||
|
|
||||||
while (isspace(*s) && s < e) {
|
if (len > 0) {
|
||||||
s++;
|
while (isspace(*s) && s < e) {
|
||||||
}
|
s++;
|
||||||
while (isspace(*e) && e > s) {
|
}
|
||||||
e--;
|
while (isspace(*e) && e > s) {
|
||||||
}
|
e--;
|
||||||
if (e - s < 1) {
|
}
|
||||||
|
}
|
||||||
|
if (e - s < 1){
|
||||||
in.time = timelib_time_ctor();
|
in.time = timelib_time_ctor();
|
||||||
add_error(&in, "Empty string");
|
add_error(&in, "Empty string");
|
||||||
if (errors) {
|
if (errors) {
|
||||||
|
Loading…
Reference in New Issue
Block a user