From: Kevin O'Connor Date: Thu, 18 Feb 2010 03:49:01 +0000 (-0500) Subject: Fix off by one error in strtcpy. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=dac46b1400787cdf04d2f3a3671bc78b3584fb71;p=seabios.git Fix off by one error in strtcpy. The strtcpy function could overrun its output buffer. --- diff --git a/src/util.c b/src/util.c index b89a2b5..bbef995 100644 --- a/src/util.c +++ b/src/util.c @@ -262,7 +262,7 @@ char * strtcpy(char *dest, const char *src, size_t len) { char *d = dest; - while (len-- && *src != '\0') + while (--len && *src != '\0') *d++ = *src++; *d = '\0'; return dest;