lpdaemon: fix bogus string termination (from sources)

This commit is contained in:
cinap_lenrek 2013-06-14 23:22:57 +02:00
parent 12853d3ba8
commit c198a557d9

View file

@ -299,14 +299,14 @@ getjobinfo(int fd)
strncpy(info.host, "unknown", NAMELEN);
else
strncpy(info.host, (const char *)&ap[1], NAMELEN);
info.host[strlen(info.host)] = '\0';
info.host[NAMELEN] = '\0';
break;
case 'P':
if (ap[1] == '\0')
strncpy(info.user, "unknown", NAMELEN);
else
strncpy(info.user, (const char *)&ap[1], NAMELEN);
info.user[strlen(info.user)] = '\0';
info.user[NAMELEN] = '\0';
break;
}
}