git.samba.org
/
gd
/
samba
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9712e3c
)
Check the return value of fgets
author
Volker Lendecke
<vl@samba.org>
Sat, 23 Feb 2008 09:42:43 +0000
(10:42 +0100)
committer
Volker Lendecke
<vl@samba.org>
Sat, 23 Feb 2008 10:04:13 +0000
(11:04 +0100)
(This used to be commit
b8aaa9a69fd6217ce0387ef8e84f316706186d70
)
source3/lib/replace/getpass.c
patch
|
blob
|
history
diff --git
a/source3/lib/replace/getpass.c
b/source3/lib/replace/getpass.c
index d91d029f6a79ced4089af86cb0b4d0a97b77b608..57e28eb981577594c2d8b6a0511fe2a21157f9ec 100644
(file)
--- a/
source3/lib/replace/getpass.c
+++ b/
source3/lib/replace/getpass.c
@@
-185,7
+185,10
@@
char *rep_getpass(const char *prompt)
buf[0] = 0;
if (!gotintr) {
in_fd = fileno(in);
- fgets(buf, bufsize, in);
+ if (fgets(buf, bufsize, in) == NULL) {
+ buf[0] = 0;
+ return buf;
+ }
}
nread = strlen(buf);
if (nread) {