diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-01-19 08:17:19 -0500 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-01-21 12:47:57 -0500 |
commit | 91d521779424409646649a84a99a20f8e8e159df (patch) | |
tree | b66d2b91da0ef0883acfbc4d32ca5d13ba6733af /src/util | |
parent | 69446016c5b06e67e6a52ca5bc05e3735f6ff5e9 (diff) | |
download | sssd-91d521779424409646649a84a99a20f8e8e159df.tar.gz sssd-91d521779424409646649a84a99a20f8e8e159df.tar.bz2 sssd-91d521779424409646649a84a99a20f8e8e159df.zip |
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
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/server.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/util/server.c b/src/util/server.c index a9be4be1..10f43fcf 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 { |