diff options
author | Andrew Bartlett <abartlet@samba.org> | 2014-09-02 11:25:07 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2014-09-08 07:26:34 +0200 |
commit | cb25480e82cb2e0ef8793fd9c21d710208c822f3 (patch) | |
tree | 8e02b2f944dc2b069fb1d646031e085579861001 /source3/libsmb/errormap.c | |
parent | b8fc4d4ab503b0e95738734c1019b9d3430908ba (diff) | |
download | samba-cb25480e82cb2e0ef8793fd9c21d710208c822f3.tar.gz samba-cb25480e82cb2e0ef8793fd9c21d710208c822f3.tar.xz samba-cb25480e82cb2e0ef8793fd9c21d710208c822f3.zip |
s3-lib: Do not walk past the end of the dos_to_ntstatus_map array
Found by AddressSanitizer
Change-Id: Ic8b3e2599713c37b11324f9ec2d01891f0f287b9
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Diffstat (limited to 'source3/libsmb/errormap.c')
-rw-r--r-- | source3/libsmb/errormap.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/libsmb/errormap.c b/source3/libsmb/errormap.c index 22daee4c5c..cc25c7ebae 100644 --- a/source3/libsmb/errormap.c +++ b/source3/libsmb/errormap.c @@ -285,7 +285,7 @@ NTSTATUS dos_to_ntstatus(uint8 eclass, uint32 ecode) { int i; if (eclass == 0) return NT_STATUS_OK; - for (i=0; NT_STATUS_V(dos_to_ntstatus_map[i].ntstatus); i++) { + for (i=0; i < ARRAY_SIZE(dos_to_ntstatus_map); i++) { if (eclass == dos_to_ntstatus_map[i].dos_class && ecode == dos_to_ntstatus_map[i].dos_code) { return dos_to_ntstatus_map[i].ntstatus; |