- ext/hash detection
[m6w6/ext-http] / http_headers_api.c
index 3cb9c9128626e48c4912c4deb665cd352c19f6b5..e8cfd6964000fe2381c13010a4f077fccb6de48f 100644 (file)
@@ -179,7 +179,7 @@ PHP_HTTP_API HashTable *_http_negotiate_q(const char *header, HashTable *support
                                        ++identifier;
                                        --ident_len;
                                }
-                               while (isspace(identifier[ident_len - 1])) {
+                               while (ident_len && isspace(identifier[ident_len - 1])) {
                                        identifier[--ident_len] = '\0';
                                }