]> git.ipfire.org Git - thirdparty/newt.git/commitdiff
checkboxtree: Don't NULL deref when an invalid array is specified
authorArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 19 Mar 2010 12:53:44 +0000 (09:53 -0300)
committerMiroslav Lichvar <mlichvar@redhat.com>
Fri, 2 Apr 2010 09:55:22 +0000 (11:55 +0200)
Invalid in the sense of asking to append to some row that doesn't exist.

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
checkboxtree.c

index 8d6e64a1776434298127e39e32e848571c3df7fa..534a46eb060d275e5f9a6d773cdec3a012f3eba5 100644 (file)
@@ -203,6 +203,8 @@ int newtCheckboxTreeAddArray(newtComponent co,
 
            i++;
            if (i < numIndexes) {
+               if (item == NULL)
+                       return -1;
                curList = item->branch;
                listPtr = &item->branch;
                if (!curList && (i + 1 != numIndexes)) return -1;