You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
arpwatch/SOURCES/arpwatch-2.1a15-unbounded-h...

16 lines
377 B

--- a/db.c 2024-01-03 10:36:30.009600848 +0100
+++ b/db.c 2024-02-21 11:35:04.420115207 +0100
@@ -283,8 +283,10 @@
BCOPY(e, ep->e, 6);
if (h == NULL && !initializing)
h = getsname(a);
- if (h != NULL && !isdigit((int)*h))
- strcpy(ep->h, h);
+ if (h != NULL) {
+ strncpy(ep->h, h, sizeof(ep->h));
+ ep->h[sizeof(ep->h) - 1] = '\0';
+ }
ep->t = t;
return (ep);
}