diff options
author | Stef Walter <stef@memberwebs.com> | 2008-06-10 00:15:36 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2008-06-10 00:15:36 +0000 |
commit | d51dfc6d13785641061bb7e7d5909a7a0f3ecfdb (patch) | |
tree | eacaf6843a443cd82cdaf0f5e35fb1eabc94a24a /plugin/dnsnotify.c | |
parent | 33846e5122fbf8a964f278eb01ad821e643bb63c (diff) |
Null terminate things propelry
Diffstat (limited to 'plugin/dnsnotify.c')
-rw-r--r-- | plugin/dnsnotify.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } } |