git.samba.org
/
nivanova
/
samba-autobuild
/
.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
64b144d
)
groupdb: Fix CID 1167984 Ignoring number of bytes read
author
Volker Lendecke
<vl@samba.org>
Fri, 30 Mar 2018 17:19:24 +0000
(12:19 -0500)
committer
Jeremy Allison
<jra@samba.org>
Tue, 3 Apr 2018 22:44:23 +0000
(
00:44
+0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/groupdb/mapping.c
patch
|
blob
|
history
diff --git
a/source3/groupdb/mapping.c
b/source3/groupdb/mapping.c
index ac70fe68c482c34966a6c66c581910e4d9e99154..1a8670e66b0cdec81f17e07d17f89af4f7ee4e1a 100644
(file)
--- a/
source3/groupdb/mapping.c
+++ b/
source3/groupdb/mapping.c
@@
-237,9
+237,13
@@
int smb_create_group(const char *unix_group, gid_t *new_gid)
if (fd != 0) {
fstring output;
+ ssize_t nread;
*new_gid = 0;
- if (read(fd, output, sizeof(output)) > 0) {
+
+ nread = read(fd, output, sizeof(output)-1);
+ if (nread > 0) {
+ output[nread] = '\0';
*new_gid = (gid_t)strtoul(output, NULL, 10);
}