MantisBT - NetSurf
View Issue Details
0002415NetSurfJavascriptpublic2016-01-27 17:552016-02-16 14:08
ReporterMichael Drake 
Assigned ToJohn-Mark Bell 
PrioritynormalSeveritycrashReproducibilityalways
StatusclosedResolutionfixed 
PlatformLinuxOSLinuxOS VersionLinux
Product Version3.4 
Target Version3.4Fixed in Version3.4 
Fixed in CI build #3333
Reported in CI build #3315
URL of problem pagetest/js/dom-body-enumerate.html
Summary0002415: Crash on test/js/dom-body-enumerate.html
DescriptionWe currently segfault on the test/js/dom-body-enumerate.html test.

In the body element binding we use an autogenerated getter for the text attribute:
  getter HTMLBodyElement::text();

This becomes a call to libdom's dom_html_body_element_get_text(). The BODY element on the document has no TEXT attribute set. So libdom returns the NULL string with no error.

The generated binding does not handle NULL strings and explodes when it dereferences the NULL dom_string.

The IDL says:

      [TreatNullAs=EmptyString] attribute DOMString text;

I am not sure if that means libdom should be changed to return an empty string, or if the generated binding should be changed to handle NULL strings.
Steps To Reproduce./nsgtk test/js/dom-body-enumerate.html
TagsNo tags attached.
Attached Files

Notes
(0001171)
Dave Higton   
2016-01-31 22:52   
Fixed in CI #3333
(0001172)
Dave Higton   
2016-01-31 22:56   
The fix: http://git.netsurf-browser.org/nsgenbind.git/commit/?id=d81d30699f57f0ca41b917c854ef6d0875a18129
(0001239)
Vincent Sanders   
2016-02-16 14:08   
Confirmed fixed in 3.4 release

Issue History
2016-01-27 17:55Michael DrakeNew Issue
2016-01-31 22:52Dave HigtonNote Added: 0001171
2016-01-31 22:56Dave HigtonNote Added: 0001172
2016-01-31 22:56Dave HigtonAssigned To => John-Mark Bell
2016-01-31 22:56Dave HigtonStatusnew => resolved
2016-01-31 22:56Dave HigtonResolutionopen => fixed
2016-01-31 22:57John-Mark BellFixed in CI build # => 3333
2016-01-31 22:57John-Mark BellProduct Version4.0 => 3.4
2016-01-31 22:57John-Mark BellFixed in Version => 3.4
2016-01-31 22:57John-Mark BellTarget Version => 3.4
2016-02-16 14:08Vincent SandersNote Added: 0001239
2016-02-16 14:08Vincent SandersStatusresolved => closed