[webkit-reviews] review granted: [Bug 92478] Extend `application/x-webkit-test-netscape` plugins to better support multiple frames. : [Attachment 155162] malloc scares me.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sun Jul 29 01:10:10 PDT 2012


Adam Barth <abarth at webkit.org> has granted  review:
Bug 92478: Extend `application/x-webkit-test-netscape` plugins to better
support multiple frames.
https://bugs.webkit.org/show_bug.cgi?id=92478

Attachment 155162: malloc scares me.
https://bugs.webkit.org/attachment.cgi?id=155162&action=review

------- Additional Comments from Adam Barth <abarth at webkit.org>
View in context: https://bugs.webkit.org/attachment.cgi?id=155162&action=review


Looks fine, if ugly old skool C.

> Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:209
> +		   char* buffer = (char*) malloc(sizeof(char) * (26 +
strlen(argv[j]) + 1));

sizeof(char) -> This is always 1 according to the C spec.

> Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp:210
> +		   sprintf(buffer, "xWebkitTestNetscapeLog('%s')", argv[j]);

sprintf -> I would use snprintf out of habit.


More information about the webkit-reviews mailing list