openldap: terminate attrs array with NULL
authorMarc Fournier <marc.fournier@camptocamp.com>
Tue, 19 Aug 2014 11:54:53 +0000 (13:54 +0200)
committerMarc Fournier <marc.fournier@camptocamp.com>
Fri, 29 Aug 2014 13:09:55 +0000 (15:09 +0200)
... as mentioned in ldap_search_ext_s(3). This fixes a segfault when
building with -O2.

src/openldap.c

index 7ce789f..e6e1c64 100644 (file)
@@ -177,14 +177,15 @@ static int ldap_read_host (user_data_t *ud) /* {{{ */
        int rc;
        int status;
 
-       char *attrs[8] = { "monitorCounter",
+       char *attrs[9] = { "monitorCounter",
                                "monitorOpCompleted",
                                "monitorOpInitiated",
                                "monitoredInfo",
                                "olmBDBEntryCache",
                                "olmBDBDNCache",
                                "olmBDBIDLCache",
-                               "namingContexts" };
+                               "namingContexts",
+                               NULL };
 
        if ((ud == NULL) || (ud->data == NULL))
        {