mirror of
http://thekelleys.org.uk/git/dnsmasq.git
synced 2026-11-19 19:51:01 +00:00
Fix lengths of interface names
Use helper function similar to copy correctly limited names into buffers.
This commit is contained in:
1 parent
2b38e3823b
commit
47b45b2967
11 files changed
+44
-26
No files matched your search
+12
-1
@@ -281,7 +281,18 @@ void *safe_malloc(size_t size)
|
||||
die(_("could not get memory"), NULL, EC_NOMEM);
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
/* Ensure limited size string is always terminated.
|
||||
* Can be replaced by (void)strlcpy() on some platforms */
|
||||
void safe_strncpy(char *dest, const char *src, size_t size)
|
||||
{
|
||||
if (size)
|
||||
{
|
||||
dest[size-1] = '\0';
|
||||
strncpy(dest, src, size-1);
|
||||
}
|
||||
}
|
||||
|
||||
void safe_pipe(int *fd, int read_noblock)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user