Dear developers,

First of all, I'd like to thank you for your efforts in making really
light and fast web browser. I enjoy using it.


I'm writing you because I want to propose a fix for a segfault I faced
with.

Steps to reproduce:
 
1. Run `./nsgtk --ca_path=""`
2. Press 'Edit->Preferences'
3. Press 'Close'

Netsurf will segfault.
The proposed patch is attached to this email. It's for version 3.2 or
3.3. I hope you will push it to upstream.


Best regards,
Vitaly
diff -ur netsurf-3.2/utils/nsoption.c netsurf-3.2.patched/utils/nsoption.c
--- netsurf-3.2/utils/nsoption.c	2014-08-26 18:57:21.000000000 +0400
+++ netsurf-3.2.patched/utils/nsoption.c	2015-03-22 23:48:53.000000000 +0300
@@ -231,7 +231,8 @@
 		 */
 		if (((defs[entry].value.s == NULL) &&
 		     (opts[entry].value.s != NULL)) ||
-		    ((defs[entry].value.s != opts[entry].value.s) &&
+		    ((opts[entry].value.s != NULL) &&
+                     (defs[entry].value.s != opts[entry].value.s) &&
 		     (strcmp(opts[entry].value.s, defs[entry].value.s) != 0))) {
 			ret = true;
 		}
@@ -255,7 +256,7 @@
 		struct nsoption_s *defs,
 		bool all)
 {
-	unsigned int entry; /* index to option being output */
+	enum nsoption_e entry; /* index to option being output */
 	colour rgbcolour; /* RRGGBB */
 
 	for (entry = 0; entry < NSOPTION_LISTEND; entry++) {

Reply via email to