On Sat, May 24, 2008 at 03:22:10AM +0000, corvid wrote:
Jeremy wrote:
Dillo crashes as follows: * Point Dillo at http://starurchin.org:8080/dillo/here * Click the "There" link. Dillo is redirected back to the "Here" page. * Click the "Reload" button. * Dillo crashes inside a_Nav_reload() (nav.c) at the line "if (URL_FLAGS(url) & URL_Post) {" because url is NULL.
The problem went away when I tried the attached change, but I may be treating the symptom rather than the disease.
diff -pur dillo2/src/nav.c dillo2-cur/src/nav.c --- dillo2/src/nav.c 2008-05-10 20:02:22.000000000 +0000 +++ dillo2-cur/src/nav.c 2008-05-24 03:03:50.000000000 +0000 @@ -185,6 +185,8 @@ static void Nav_stack_clean(BrowserWindo void *data = dList_nth_data (bw->nav_stack, i - 1); dList_remove_fast (bw->nav_stack, data); dFree(data); + if (bw->nav_stack_ptr >= a_Nav_stack_size(bw)) + bw->nav_stack_ptr = a_Nav_stack_size(bw) - 1; } }
I think this addresses the real problem, which is that bw->nav_stack_ptr is an index into bw->nav_stack , so if we modify the latter we must ensure the former is valid. Reviewing the rest of nav.c I think there is a similar potential problem with Nav_stack_insert() , which also modifies bw->nav_stack . Shouldn't it increment bw->nav_stack_ptr if it is after the insertion point? Otherwise the displayed item might change unexpectedly. Regards, Jeremy Henty