commit | 0bbab0e789d4d8438d63327da052d64b45f0596a | [log] [tgz] |
---|---|---|
author | Jens Axboe <jens.axboe@oracle.com> | Thu Nov 02 09:18:36 2006 +0100 |
committer | Jens Axboe <jens.axboe@oracle.com> | Thu Nov 02 09:18:36 2006 +0100 |
tree | 923baa901976443785240829230345920872b4aa | |
parent | b1508cf9ead36dc789a4e289f7522a070e57058c [diff] [blame] |
[PATCH] String copy limiting fixes Avoid overflows when we can. Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/parse.c b/parse.c index ae8d0d9..9f2ee0d 100644 --- a/parse.c +++ b/parse.c
@@ -178,7 +178,7 @@ char tmp[128]; char *p1, *p2; - strcpy(tmp, ptr); + strncpy(tmp, ptr, sizeof(tmp) - 1); p1 = strchr(tmp, '-'); if (!p1) { @@ -267,7 +267,7 @@ char *pre, *post; char tmp[64]; - strcpy(tmp, opt); + strncpy(tmp, opt, sizeof(tmp) - 1); pre = strchr(tmp, '='); if (pre) {