diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2001-04-29 22:45:13 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2001-04-29 22:45:13 +0000 |
commit | ff22fa3bb18d5bd296027f9b142e767e1b767aa4 (patch) | |
tree | d0e3af03da750f46313a391611d307786b0f68aa | |
parent | d32ef3c81008fa73676f634c9d2fe6e851db7020 (diff) |
Zero a buffer prior to passing it to readlink() as readlink()
does not append a NUL itself.
-rw-r--r-- | usr.bin/sup/src/supcmeat.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/sup/src/supcmeat.c b/usr.bin/sup/src/supcmeat.c index 0bc6287b94c..09243dedefa 100644 --- a/usr.bin/sup/src/supcmeat.c +++ b/usr.bin/sup/src/supcmeat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: supcmeat.c,v 1.11 2001/04/29 21:52:16 millert Exp $ */ +/* $OpenBSD: supcmeat.c,v 1.12 2001/04/29 22:45:12 millert Exp $ */ /* * Copyright (c) 1992 Carnegie Mellon University @@ -891,6 +891,7 @@ register struct stat *statp; return (TRUE); } linkname = t->Tlink->Tname; + memset(buf, 0, sizeof(buf)); if (!new && (t->Tflags&FNEW) == 0 && (n = readlink (t->Tname,buf,sizeof(buf)-1)) >= 0 && (n == strlen (linkname)) && (strncmp (linkname,buf,n) == 0)) |