summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-06-10 00:15:36 +0000
committerStef Walter <stef@memberwebs.com>2008-06-10 00:15:36 +0000
commitd51dfc6d13785641061bb7e7d5909a7a0f3ecfdb (patch)
treeeacaf6843a443cd82cdaf0f5e35fb1eabc94a24a
parent33846e5122fbf8a964f278eb01ad821e643bb63c (diff)
Null terminate things propelry
l---------INSTALL2
-rw-r--r--plugin/autoserial.c3
-rw-r--r--plugin/dnsnotify.c5
-rw-r--r--plugin/plugin.c3
4 files changed, 11 insertions, 2 deletions
diff --git a/INSTALL b/INSTALL
index fbcd9e5..5bb6e7b 120000
--- a/INSTALL
+++ b/INSTALL
@@ -1 +1 @@
-/usr/local/share/automake-1.9/INSTALL \ No newline at end of file
+/usr/share/automake-1.10/INSTALL \ No newline at end of file
diff --git a/plugin/autoserial.c b/plugin/autoserial.c
index 16af5d7..7380cef 100644
--- a/plugin/autoserial.c
+++ b/plugin/autoserial.c
@@ -100,6 +100,9 @@ search_for_dns (const char *base, const char *filter, char ***results)
*(d++) = dn;
}
+ /* Null terminate */
+ *d = NULL;
+
slapi_pblock_destroy (pb);
*results = dns;
diff --git a/plugin/dnsnotify.c b/plugin/dnsnotify.c
index fd9d722..a81feb1 100644
--- a/plugin/dnsnotify.c
+++ b/plugin/dnsnotify.c
@@ -97,13 +97,16 @@ load_soa_ns_attributes (const char *dn, char **soa_result, char ***ns_result)
for (v = values; *v; ++v)
++num;
- ns = (char**)slapi_ch_calloc (num, sizeof (char*));
+ ns = (char**)slapi_ch_calloc (num + 1, sizeof (char*));
for (i = 0; i < num; ++i) {
ns[i] = slapi_ch_malloc (values[i]->bv_len + 1);
if (values[i]->bv_len)
memcpy (ns[i], values[i]->bv_val, values[i]->bv_len);
ns[i][values[i]->bv_len] = 0;
}
+
+ /* Null terminate */
+ ns[i] = NULL;
}
}
diff --git a/plugin/plugin.c b/plugin/plugin.c
index 54144ba..150e605 100644
--- a/plugin/plugin.c
+++ b/plugin/plugin.c
@@ -332,6 +332,9 @@ plugin_init (Slapi_PBlock *pb)
log_plugin ("unrecognized plugin argument: %s", argv[i]);
}
+ /* Null terminate */
+ plugin_arguments[i] = NULL;
+
/* Next we initialize all components */
if (autoserial_init () < 0 ||
dnsnotify_init() < 0)