i agree ... applied to 9atom.
Subject: [sources] applied patch: /n/atom/patch/applied/lpdaemonnit
Reply-To: [email protected]
email
[email protected]
readme
>From: yaroslav <[email protected]>
>Subject: [9fans] lpdaemon
in /sys/src/cmd/lp/lpdaemon.c:297,310
These
info.host[strlen(info.host)] = '\0';
…
info.user[strlen(info.user)] = '\0';
look nonsence as zeros are placed exactly where they already are.
Should read as in following instead:
info.host[NAMELEN] = '\0';
…
info.user[NAMELEN] = '\0';
removed
files
/sys/src/cmd/lp/lpdaemon.c lpdaemon.c
/sys/src/cmd/lp/lpdaemon.c lpdaemon.c
lpdaemon.c.orig:299,305 - lpdaemon.c:299,305
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')
lpdaemon.c.orig:306,312 - lpdaemon.c:306,312
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;
}
}
------
merge...backup...copy...
cpfile lpdaemon.c /n/dist/sys/src/cmd/lp/lpdaemon.c
# remove these files if you want. I will not remove them for you
# ($patch/undo will not restore them)
done