summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-06-20 10:26:58 +0200
committerMichael Adam <obnox@samba.org>2012-06-20 12:53:59 +0200
commitdb9180c3d91253ee7dac1ed943f9a5a5b9e1a5a7 (patch)
tree3472593573d497e364dfc4c2873942d3ad60b3cb /source3
parent963666a3feb4a140d44fe70a23ab42420dc1c45b (diff)
downloadsamba-db9180c3d91253ee7dac1ed943f9a5a5b9e1a5a7.tar.gz
samba-db9180c3d91253ee7dac1ed943f9a5a5b9e1a5a7.tar.bz2
samba-db9180c3d91253ee7dac1ed943f9a5a5b9e1a5a7.zip
idmap-hash: Attempt to fix Coverity ID 709116 Overflowed array index write
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
Diffstat (limited to 'source3')
-rw-r--r--source3/winbindd/idmap_hash/mapfile.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/winbindd/idmap_hash/mapfile.c b/source3/winbindd/idmap_hash/mapfile.c
index ec846f37eb..a0e2b489cb 100644
--- 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';
}