diff options
author | 2009-12-10 21:36:49 +0100 | |
---|---|---|
committer | 2009-12-10 21:36:49 +0100 | |
commit | e2ee21995ee43411965ec9f7e7a95f3c139850b2 (patch) | |
tree | 42997bdcfc1c8fc02a630ee6519c36508b9eda3d /main.c | |
parent | 4ab1899f5deb4764bde692d6b14c27eb862a6196 (diff) |
fixed possible stack overflow bug after call to realpath
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -373,6 +373,9 @@ main (int argc, char *argv[]) { // path of this process if (argv[i][0] != '-' && realpath (argv[i], resolved)) { len = strlen (resolved); + if (len >= size) { + break; + } memcpy (p, resolved, len+1); } else { |