mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-21 03:32:35 +03:00
Fix segmentation fault when a string option is set to NULL
The check for a user option being a default value was not protecting against the value being set to NULL.
This commit is contained in:
parent
b54174e54a
commit
c3b7e650c5
@ -16,7 +16,8 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/** \file
|
||||
/**
|
||||
* \file
|
||||
* Option reading and saving (implementation).
|
||||
*
|
||||
* Options are stored in the format key:value, one per line.
|
||||
@ -232,6 +233,8 @@ nsoption_is_set(const struct nsoption_s *opts,
|
||||
*/
|
||||
if (((defs[entry].value.s == NULL) &&
|
||||
(opts[entry].value.s != NULL)) ||
|
||||
((defs[entry].value.s != NULL) &&
|
||||
(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;
|
||||
|
Loading…
Reference in New Issue
Block a user