From 91d521779424409646649a84a99a20f8e8e159df Mon Sep 17 00:00:00 2001 From: Stephen Gallagher Date: Thu, 19 Jan 2012 08:17:19 -0500 Subject: Fix invalid index in pidfile() If we hit the "read too much, this should never happen" line, we would write a NULL-terminator past the end of the static buffer. Coverity 12472 --- src/util/server.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/util/server.c') diff --git a/src/util/server.c b/src/util/server.c index a9be4be1a..10f43fcf5 100644 --- a/src/util/server.c +++ b/src/util/server.c @@ -129,7 +129,9 @@ int pidfile(const char *path, const char *name) len += ret; if (len > pidlen) { DEBUG(1, ("read too much, this should never happen.\n")); - break; + close(fd); + talloc_free(file); + return EINVAL; } continue; } else { -- cgit