git.samba.org
/
ddiss
/
samba.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
963666a
)
idmap-hash: Attempt to fix Coverity ID 709116 Overflowed array index write
author
Volker Lendecke
<vl@samba.org>
Wed, 20 Jun 2012 08:26:58 +0000
(10:26 +0200)
committer
Michael Adam
<obnox@samba.org>
Wed, 20 Jun 2012 10:53:59 +0000
(12:53 +0200)
Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Jun 20 12:53:59 CEST 2012 on sn-devel-104
source3/winbindd/idmap_hash/mapfile.c
patch
|
blob
|
history
diff --git
a/source3/winbindd/idmap_hash/mapfile.c
b/source3/winbindd/idmap_hash/mapfile.c
index ec846f37eb69b726df1cb508d2a458f90914f7ec..a0e2b489cbb0e1f76a6caaa60adeb1a63f112e45 100644
(file)
--- a/
source3/winbindd/idmap_hash/mapfile.c
+++ b/
source3/winbindd/idmap_hash/mapfile.c
@@
-74,7
+74,12
@@
static bool mapfile_read_line(fstring key, fstring value)
/* Strip newlines and carriage returns */
- len = strlen_m(buffer) - 1;
+ len = strlen_m(buffer);
+ if (len == 0) {
+ return false;
+ }
+ len -= 1;
+
while ((buffer[len] == '\n') || (buffer[len] == '\r')) {
buffer[len--] = '\0';
}