Changeset 140751 in webkit
- Timestamp:
- Jan 24, 2013 4:56:19 PM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r140749 r140751 1 2013-01-24 Julien Brianceau <jbrianceau@nds.com> 2 3 NPN_InitializeVariantWithStringCopy is wrong for platforms returning NULL from malloc(0) 4 https://bugs.webkit.org/show_bug.cgi?id=96272 5 6 Reviewed by Alexey Proskuryakov. 7 8 No new tests. This is platform dependent. 9 10 * bridge/npruntime.cpp: 11 (NPN_InitializeVariantWithStringCopy): 12 1 13 2013-01-24 Christian Biesinger <cbiesinger@chromium.org> 2 14 -
trunk/Source/WebCore/bridge/npruntime.cpp
r40415 r140751 86 86 variant->type = NPVariantType_String; 87 87 variant->value.stringValue.UTF8Length = value->UTF8Length; 88 variant->value.stringValue.UTF8Characters = (NPUTF8 *)malloc(sizeof(NPUTF8) * value->UTF8Length); 89 if (!variant->value.stringValue.UTF8Characters) 88 // Switching to fastMalloc would be better to avoid length check but this is not desirable 89 // as NPN_MemAlloc is using malloc and there might be plugins that mix NPN_MemAlloc and malloc too. 90 variant->value.stringValue.UTF8Characters = (NPUTF8*)malloc(sizeof(NPUTF8) * value->UTF8Length); 91 if (value->UTF8Length && !variant->value.stringValue.UTF8Characters) 90 92 CRASH(); 91 93 memcpy((void*)variant->value.stringValue.UTF8Characters, value->UTF8Characters, sizeof(NPUTF8) * value->UTF8Length);
Note: See TracChangeset
for help on using the changeset viewer.