Skip to content

Commit

Permalink
aix: get rid of strcat() calls
Browse files Browse the repository at this point in the history
Insecure and unnecessary. Replace them with a call to snprintf().

PR-URL: libuv#2065
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Richard Lau <[email protected]>
  • Loading branch information
bnoordhuis committed Dec 4, 2018
1 parent 3909e7f commit bc50d10
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/unix/aix.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,7 @@ static char *uv__rawname(char *cp) {
if (dp == 0)
return 0;

*dp = 0;
/* TODO(bnoordhuis) Check uv__strscpy() return value. */
uv__strscpy(rawbuf, cp, sizeof(rawbuf));
*dp = '/';
strcat(rawbuf, "/r");
strcat(rawbuf, dp+1);
snprintf(rawbuf, sizeof(rawbuf), "%.*s/r/%s", (int) (cp - dp), cp, dp + 1);
return rawbuf;
}

Expand Down

0 comments on commit bc50d10

Please sign in to comment.