fix PHP-73185
authorMichael Wallner <mike@php.net>
Tue, 4 Oct 2016 08:13:35 +0000 (10:13 +0200)
committerMichael Wallner <mike@php.net>
Tue, 4 Oct 2016 08:13:35 +0000 (10:13 +0200)
src/php_http_url.c

index 8384f99a8c7df39e2d3e678de739c3f38308c68b..474a7bfed85350d7fc5681da723f0bb3826e35a6 100644 (file)
@@ -836,7 +836,7 @@ static ZEND_RESULT_CODE parse_userinfo(struct parse_state *state, const char *pt
                        break;
 
                }
-       } while(++ptr != end);
+       } while(++ptr < end);
 
 
        state->buffer[state->offset++] = 0;
@@ -1231,7 +1231,7 @@ static ZEND_RESULT_CODE parse_hostinfo(struct parse_state *state, const char *pt
                        label = ptr;
                        ptr += mb - 1;
                }
-       } while (++ptr != end);
+       } while (++ptr < end);
 
        if (!state->url.host) {
                len = state->offset - len;
@@ -1612,7 +1612,7 @@ static const char *parse_scheme(struct parse_state *state)
                        }
                        state->ptr += mb - 1;
                }
-       } while (++state->ptr != state->end);
+       } while (++state->ptr < state->end);
 
 softfail:
        state->offset = 0;