nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 43040220bf3b0cb2ef0c0f0541d36b89b8f6ce67
parent 8fea3472a9b76dba307e1fbbc54589f56b27e04c
Author: Benno Schulenberg <bensberg@justemail.net>
Date:   Mon, 14 Mar 2016 16:01:44 +0000

Avoiding to dereference a possible NULL.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5735 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

Diffstat:
MChangeLog | 3+++
Msrc/color.c | 2+-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,6 @@ +2016-03-14 Benno Schulenberg <bensberg@justemail.net> + * src/color.c (color_update): Don't dereference a possible NULL. + 2016-03-13 Benno Schulenberg <bensberg@justemail.net> * src/search.c (regexp_init): Allow using the word boundary markers \< and \> in search strings on non-GNU systems. This is a partial diff --git a/src/color.c b/src/color.c @@ -280,7 +280,7 @@ void color_update(void) /* If a syntax was found, compile its specified regexes (which have * already been checked for validity when they were read in). */ - for (ink = sint->color; ink != NULL; ink = ink->next) { + for (ink = openfile->colorstrings; ink != NULL; ink = ink->next) { if (ink->start == NULL) { ink->start = (regex_t *)nmalloc(sizeof(regex_t)); regcomp(ink->start, fixbounds(ink->start_regex), ink->rex_flags);