mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-17 16:10:46 +01:00
Fix a silly bug where MAXPATHLEN was subtracted from the string length rather
than the other way around! Submitted by: Elmar Bartel <bartel@informatik.tu-muenchen.de>
This commit is contained in:
parent
adc1189458
commit
abdec3e35c
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=11770
@ -539,8 +539,8 @@ rawname(cp)
|
||||
*dp = '\0';
|
||||
(void)strncpy(rawbuf, cp, MAXPATHLEN - 1);
|
||||
*dp = '/';
|
||||
(void)strncat(rawbuf, "/r", strlen(rawbuf) - (MAXPATHLEN - 1));
|
||||
(void)strncat(rawbuf, dp + 1, strlen(rawbuf) - (MAXPATHLEN - 1));
|
||||
(void)strncat(rawbuf, "/r", MAXPATHLEN-1 - strlen(rawbuf));
|
||||
(void)strncat(rawbuf, dp + 1, MAXPATHLEN-1 - strlen(rawbuf));
|
||||
return (rawbuf);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user