forked from Imagelibrary/rtems
2003-04-15 Joel Sherrill <joel@OARcorp.com>
PR 388/networking * kern/kern_sysctl.c: Revert previous patch and use strlcpy() now that it is available. Also fixed some warnings.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2003-04-15 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
|
PR 388/networking
|
||||||
|
* kern/kern_sysctl.c: Revert previous patch and use strlcpy() now that
|
||||||
|
it is available. Also fixed some warnings.
|
||||||
|
|
||||||
2003-03-27 Joel Sherrill <joel@OARcorp.com>
|
2003-03-27 Joel Sherrill <joel@OARcorp.com>
|
||||||
|
|
||||||
* kern/kern_sysctl.c: Converted from BSP strlcpy() to strncpy().
|
* kern/kern_sysctl.c: Converted from BSP strlcpy() to strncpy().
|
||||||
|
|||||||
@@ -59,6 +59,9 @@
|
|||||||
#include <sys/sysproto.h>
|
#include <sys/sysproto.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/buf.h>
|
#include <sys/buf.h>
|
||||||
|
|
||||||
|
#include <stdio.h> /* for snprintf() */
|
||||||
|
size_t strlcpy(char *, const char *, size_t);
|
||||||
#endif
|
#endif
|
||||||
#include <vm/vm.h>
|
#include <vm/vm.h>
|
||||||
#include <vm/vm_extern.h>
|
#include <vm/vm_extern.h>
|
||||||
@@ -856,7 +859,7 @@ retry:
|
|||||||
outlen = strlen((char *)arg1)+1;
|
outlen = strlen((char *)arg1)+1;
|
||||||
tmparg = malloc(outlen, M_SYSCTLTMP, M_WAITOK);
|
tmparg = malloc(outlen, M_SYSCTLTMP, M_WAITOK);
|
||||||
|
|
||||||
if (strncpy(tmparg, (char *)arg1, outlen) >= outlen) {
|
if (strlcpy(tmparg, (char *)arg1, outlen) >= outlen) {
|
||||||
free(tmparg, M_SYSCTLTMP);
|
free(tmparg, M_SYSCTLTMP);
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user