From c198a557d9daf28f6b69f818ad570f88c78d7693 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Fri, 14 Jun 2013 23:22:57 +0200 Subject: [PATCH] lpdaemon: fix bogus string termination (from sources) --- sys/src/cmd/lp/lpdaemon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/src/cmd/lp/lpdaemon.c b/sys/src/cmd/lp/lpdaemon.c index bfd974e59..76ffc6242 100644 --- a/sys/src/cmd/lp/lpdaemon.c +++ b/sys/src/cmd/lp/lpdaemon.c @@ -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; } }