mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
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
This commit is contained in:
parent
963666a3fe
commit
db9180c3d9
@ -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';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user