Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
unix: fix buffer overrun in uv__strlcpy()
Reported by Thomas Shinnick.
  • Loading branch information
bnoordhuis committed Sep 6, 2011
1 parent e8ab5cb commit cc91989
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/unix/core.c
Expand Up @@ -764,10 +764,8 @@ size_t uv__strlcpy(char* dst, const char* src, size_t size) {
}

org = src;
while (size > 1) {
if ((*dst++ = *src++) == '\0') {
return org - src;
}
while (--size && *src) {
*dst++ = *src++;
}
*dst = '\0';

Expand Down

0 comments on commit cc91989

Please sign in to comment.