|
@@ -79,7 +79,7 @@ LSUP_nsmap_add (NSMap *map, const char *pfx, const char *nsstr)
|
|
log_warn(
|
|
log_warn(
|
|
"Prefix `%s` is longer than the maximum allowed size "
|
|
"Prefix `%s` is longer than the maximum allowed size "
|
|
"(%d characters). Truncating.", pfx, PFX_LEN - 1);
|
|
"(%d characters). Truncating.", pfx, PFX_LEN - 1);
|
|
- strncpy (entry_s.pfx, pfx, sizeof (entry_s.pfx));
|
|
|
|
|
|
+ strncpy (entry_s.pfx, pfx, PFX_LEN -1);
|
|
char *ns = strdup (nsstr);
|
|
char *ns = strdup (nsstr);
|
|
|
|
|
|
NSEntry *ret = hashmap_get (map, &entry_s);
|
|
NSEntry *ret = hashmap_get (map, &entry_s);
|
|
@@ -105,7 +105,7 @@ LSUP_rc
|
|
LSUP_nsmap_remove (NSMap *map, const char *pfx)
|
|
LSUP_nsmap_remove (NSMap *map, const char *pfx)
|
|
{
|
|
{
|
|
NSEntry entry_s;
|
|
NSEntry entry_s;
|
|
- strncpy (entry_s.pfx, pfx, PFX_LEN);
|
|
|
|
|
|
+ strncpy (entry_s.pfx, pfx, PFX_LEN - 1);
|
|
NSEntry *entry = hashmap_delete (map, &entry_s);
|
|
NSEntry *entry = hashmap_delete (map, &entry_s);
|
|
|
|
|
|
if (!entry) return LSUP_NOACTION;
|
|
if (!entry) return LSUP_NOACTION;
|
|
@@ -120,7 +120,7 @@ const char *
|
|
LSUP_nsmap_get_ns (const NSMap *map, const char *pfx)
|
|
LSUP_nsmap_get_ns (const NSMap *map, const char *pfx)
|
|
{
|
|
{
|
|
NSEntry entry_s;
|
|
NSEntry entry_s;
|
|
- strncpy (entry_s.pfx, pfx, PFX_LEN);
|
|
|
|
|
|
+ strncpy (entry_s.pfx, pfx, PFX_LEN - 1);
|
|
NSEntry *entry = hashmap_get ((NSMap *)map, &entry_s);
|
|
NSEntry *entry = hashmap_get ((NSMap *)map, &entry_s);
|
|
|
|
|
|
return (entry) ? entry->ns : NULL;
|
|
return (entry) ? entry->ns : NULL;
|