зеркало из https://github.com/mozilla/pjs.git
Don't under-malloc for short script filename entry (223810, r=shaver, a=dbaron).
This commit is contained in:
Родитель
7a27515d50
Коммит
6b1992aefa
|
@ -859,8 +859,9 @@ typedef struct ScriptFilenameEntry {
|
|||
JS_STATIC_DLL_CALLBACK(JSHashEntry *)
|
||||
js_alloc_entry(void *priv, const void *key)
|
||||
{
|
||||
return (JSHashEntry *)
|
||||
malloc(offsetof(ScriptFilenameEntry, filename) + strlen(key) + 1);
|
||||
size_t nbytes = offsetof(ScriptFilenameEntry, filename) + strlen(key) + 1;
|
||||
|
||||
return (JSHashEntry *) malloc(JS_MAX(nbytes, sizeof(JSHashEntry)));
|
||||
}
|
||||
|
||||
JS_STATIC_DLL_CALLBACK(void)
|
||||
|
|
Загрузка…
Ссылка в новой задаче