click on the image in this page: <html> <body> <a href="http://www.google.com"> <img src="http://www.google.com/images/logo.gif"></a> </body> </html> Dillo will segfault. Apparently, this is because there is no selectable content in the page. a_Dw_ext_iterator_new() is returning NULL at selection.c:152 selection->link = a_Dw_ext_iterator_new (it); selection->link_char = Selection_correct_char_pos (selection->link, char_pos); selection->link_number = link; ret = TRUE; So I tried a naive quick fix: selection->link = a_Dw_ext_iterator_new (it); if( selection->link ) { selection->link_char = Selection_correct_char_pos (selection->link, char_pos); selection->link_number = link; ret = TRUE; } else ret = FALSE; This just moved the bug elsewhere because dillo then segfaulted when I clicked the image and held the button down and moved off of it. Selection_switch_link_to_selection() expects a non NULL iterator.
On Tue, Jul 01, Joe Crayne wrote:
click on the image in this page:
<html> <body> <a href="http://www.google.com"> <img src="http://www.google.com/images/logo.gif"></a> </body> </html>
Dillo will segfault.
Apparently, this is because there is no selectable content in the page. a_Dw_ext_iterator_new() is returning NULL at selection.c:152
selection->link = a_Dw_ext_iterator_new (it); selection->link_char = Selection_correct_char_pos (selection->link, char_pos); selection->link_number = link; ret = TRUE;
So I tried a naive quick fix:
selection->link = a_Dw_ext_iterator_new (it); if( selection->link ) { selection->link_char = Selection_correct_char_pos (selection->link, char_pos); selection->link_number = link; ret = TRUE; } else ret = FALSE;
This just moved the bug elsewhere because dillo then segfaulted when I clicked the image and held the button down and moved off of it. Selection_switch_link_to_selection() expects a non NULL iterator.
I've just committed a fix, which also changes Selection_switch_link_to_selection(). The best may be to let a_Dw_ext_iterator_new() never return NULL, but instead a special, "empty" DwExtIterator, so that all calling code can expect a valid iterator. This would simplify the code using DwExtIterator, and make it more robust. BTW, the page is invalid HTML, <img> must have a value for the ALT attribute, which whould then prevent the crash ;-) Sebastian
participants (2)
-
Joe Crayne
-
Sebastian Geerken