lpdaemon: fix bogus string termination (from sources)
This commit is contained in:
parent
12853d3ba8
commit
c198a557d9
|
@ -299,14 +299,14 @@ getjobinfo(int fd)
|
||||||
strncpy(info.host, "unknown", NAMELEN);
|
strncpy(info.host, "unknown", NAMELEN);
|
||||||
else
|
else
|
||||||
strncpy(info.host, (const char *)&ap[1], NAMELEN);
|
strncpy(info.host, (const char *)&ap[1], NAMELEN);
|
||||||
info.host[strlen(info.host)] = '\0';
|
info.host[NAMELEN] = '\0';
|
||||||
break;
|
break;
|
||||||
case 'P':
|
case 'P':
|
||||||
if (ap[1] == '\0')
|
if (ap[1] == '\0')
|
||||||
strncpy(info.user, "unknown", NAMELEN);
|
strncpy(info.user, "unknown", NAMELEN);
|
||||||
else
|
else
|
||||||
strncpy(info.user, (const char *)&ap[1], NAMELEN);
|
strncpy(info.user, (const char *)&ap[1], NAMELEN);
|
||||||
info.user[strlen(info.user)] = '\0';
|
info.user[NAMELEN] = '\0';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue