Pārlūkot izejas kodu

Bug 630097 - (cov#11938) NULL dereference in mmldif

There is a chance that a can be NULL, which we then dereference
within the else block.  We should not execute the else block if
a is NULL.
Nathan Kinder 15 gadi atpakaļ
vecāks
revīzija
470e2c7033
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      ldap/servers/slapd/tools/mmldif.c

+ 1 - 1
ldap/servers/slapd/tools/mmldif.c

@@ -1108,7 +1108,7 @@ addmodified(FILE * edf3, attrib1_t * attrib, record_t * first)
             } while (num_b <= tot_b && stricmp(attribname(b), attrname) == 0);
             fprintf(edf3, "-\n");
             continue;
-        } else {
+        } else if (a != NULL) {
             /* a == b */
             int nmods = 0;
             attrib_t *begin_b = b;