Bug 22798 - Unitialized struct field in SVGFont.cpp
Summary: Unitialized struct field in SVGFont.cpp
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Text (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-12-10 14:33 PST by Dave Moore
Modified: 2008-12-12 17:22 PST (History)
1 user (show)

See Also:


Attachments
Patch to fix (484 bytes, text/plain)
2008-12-10 14:46 PST, Dave Moore
no flags Details
Patch to fix (1.44 KB, patch)
2008-12-11 09:48 PST, Dave Moore
eric: review+
Details | Formatted Diff | Diff
Patch to fix (1.55 KB, patch)
2008-12-11 12:02 PST, Dave Moore
eric: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dave Moore 2008-12-10 14:33:48 PST
In Font::drawTextUsingSVGFont() a variable of type SVGTextRunWalkerDrawTextData is created on the stack (called data). One of its fields, charsConsumed, is unitialized, leading to random values after calling walk() on the SVGTextRunWalker created with it.

Patch will be attached
Comment 1 Dave Moore 2008-12-10 14:46:53 PST
Created attachment 25926 [details]
Patch to fix

This patch adds initialization of the charsConsumed field
Comment 2 Dave Moore 2008-12-11 09:48:35 PST
Created attachment 25952 [details]
Patch to fix
Comment 3 Eric Seidel (no email) 2008-12-11 11:36:04 PST
Comment on attachment 25952 [details]
Patch to fix

Just nits:
 1 2008-12-11  davemoore  <davemoore@google.com>

Should be:
 1 2008-12-11  David Moore  <davemoore@google.com>

(See my email on changelog entries sent to chrome-team last week.)

WARNING: NO TEST CASES ADDED OR CHANGED

can be removed and replaced when an explanation as to why it's untestable.

 5 	Fixed https://bugs.webkit.org/show_bug.cgi?id=22798

Looks like a tab (or maybe just bad indentation)

Looks fine.  We could also have fixed this by adding a constructor to SVGTextRunWalkerMeasuredLengthData (which would have possibly prevented future such UMRs.


Marking r- for the nits.  Post another copy and I'll be happy to review and land it for you.  Thanks for the fix!
Comment 4 Dave Moore 2008-12-11 12:02:27 PST
Created attachment 25956 [details]
Patch to fix

Fixed review issues
Comment 5 Eric Seidel (no email) 2008-12-11 14:09:32 PST
Comment on attachment 25956 [details]
Patch to fix

Looks fine.
Comment 6 Eric Seidel (no email) 2008-12-12 17:22:00 PST
Only snag I hit was one tab in the ChangeLog (we have a pre-commit script which fails if tabs are in any file).  Otherwise the patch was great!

Committing to http://svn.webkit.org/repository/webkit/trunk ...
	M	WebCore/ChangeLog
	M	WebCore/svg/SVGFont.cpp
Committed r39260