Page MenuHomeFreeBSD

D29370.diff
No OneTemporary

D29370.diff

diff --git a/usr.sbin/services_mkdb/uniq.c b/usr.sbin/services_mkdb/uniq.c
--- a/usr.sbin/services_mkdb/uniq.c
+++ b/usr.sbin/services_mkdb/uniq.c
@@ -120,12 +120,13 @@
for (p = (const unsigned char *)origline; l && *p && isspace(*p);
p++, l--)
continue;
+ if (*p == '\0' || l == 0)
+ return 0;
+
if ((cline = malloc(l + 1)) == NULL)
err(1, "Cannot allocate %zu bytes", l + 1);
(void)memcpy(cline, p, l);
cline[l] = '\0';
- if (*cline == '\0')
- return 0;
complen = 0;
hasalnum = 0;
@@ -155,6 +156,11 @@
--complen;
}
*q = '\0';
+ if (!hasalnum) {
+ free(cline);
+ cline = NULL;
+ complen = 0;
+ }
*compline = cline;
*len = complen;
return hasalnum;

File Metadata

Mime Type
text/plain
Expires
Thu, Sep 26, 3:18 AM (21 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
12809468
Default Alt Text
D29370.diff (694 B)

Event Timeline