diff options
author | fjoe <fjoe@FreeBSD.org> | 2005-11-30 20:38:03 +0000 |
---|---|---|
committer | fjoe <fjoe@FreeBSD.org> | 2005-11-30 20:38:03 +0000 |
commit | f243cd906e715a43fad19bdf09a9458e0b0b6509 (patch) | |
tree | f75a312081b6cefd6f373cc2f083927e1093552d /usr.bin/make/var.c | |
parent | ef3f2fcd849beabec9e9e9cbb5874f477998babc (diff) | |
download | FreeBSD-src-f243cd906e715a43fad19bdf09a9458e0b0b6509.zip FreeBSD-src-f243cd906e715a43fad19bdf09a9458e0b0b6509.tar.gz |
- match_var: do not address memory at invalid address (`len' can be greater
than strlen(var) + 1)
- ReadMakeFile: prevent `fname' memory leak
- ReadMakeFile: prevent double free (caused by double fclose) --
ParsePopInput() closes input file
Reviewed by: harti
Diffstat (limited to 'usr.bin/make/var.c')
-rw-r--r-- | usr.bin/make/var.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.bin/make/var.c b/usr.bin/make/var.c index 9844e16..ff1bf09 100644 --- a/usr.bin/make/var.c +++ b/usr.bin/make/var.c @@ -2246,7 +2246,7 @@ match_var(const char str[], const char var[]) str[0] == CLOSE_BRACE) { len = str - (start + 2); - if (var[len] == '\0' && strncmp(var, start + 2, len) == 0) { + if (strncmp(var, start + 2, len) == 0 && var[len] == '\0') { return (0); /* match */ } else { /* |