Commit a00aecaf authored by Geoff Simmons's avatar Geoff Simmons

PH lookup fails fast when the subject string length is out of range.

parent 5b9ddbf5
......@@ -360,8 +360,9 @@ PH_Lookup(const struct ph * const restrict ph,
len = strlen(subject);
h = hash(ph->h1, subject, len);
if (h != UINT_MAX)
idx = ph->tbl[h].idx;
if (h == UINT_MAX)
return (UINT_MAX);
idx = ph->tbl[h].idx;
if (vbit_test(ph->collision, h)) {
struct hash *h2 = ph->tbl[h].h2;
CHECK_OBJ_NOTNULL(h2, HASH_MAGIC);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment