From fd9efee21d1ed8029032eefe356bcca6d06ae671 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 23 Mar 2008 15:56:41 +0100 Subject: Fix Coverity ID 436 (This used to be commit 9e0ee1ad4fe0f0e7dec0b6824ef234147d845b8d) --- source3/lib/popt_common.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/source3/lib/popt_common.c b/source3/lib/popt_common.c index 7f7d23fa00..8f0f7c62bb 100644 --- a/source3/lib/popt_common.c +++ b/source3/lib/popt_common.c @@ -327,6 +327,11 @@ static void get_password_file(void) close_it = True; } + if (fd < 0) { + fprintf(stderr, "fd = %d, < 0\n", fd); + exit(1); + } + for(p = pass, *p = '\0'; /* ensure that pass is null-terminated */ p && p - pass < sizeof(pass);) { switch (read(fd, p, 1)) { -- cgit