I don't purposely trying to hash a null string, only that I encountered a crash today, and tracing deep deep into the stack, the cause is this.
So I looked at the file, also in line 110, hash() also assumes none-NULL input. What value should we return for hash(NULL)? On Wed, Apr 13, 2011 at 5:14 PM, Eric Seidel <[email protected]> wrote: > Why are you hashing a null string? aka String(). We could make that > function support null strings, but I guess it hasn't needed to until > now. > > On Wed, Apr 13, 2011 at 5:00 PM, Mo, Zhenyao <[email protected]> wrote: >> In StringHash.h line 89 >> >> StringHash::hash(const String& key) { return key.impl()->hash(); } >> >> so it assumes String::impl() never returns NULL. >> >> However, I encountered a case where String::impl() is NULL, thus, crash. >> >> So what's wrong here? >> _______________________________________________ >> webkit-dev mailing list >> [email protected] >> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev >> > _______________________________________________ webkit-dev mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

