perfcount: Fix CID 1035493 Out-of-bounds read
authorVolker Lendecke <vl@samba.org>
Thu, 5 Mar 2015 10:11:59 +0000 (11:11 +0100)
committerIra Cooper <ira@samba.org>
Thu, 5 Mar 2015 14:59:12 +0000 (15:59 +0100)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
source3/modules/perfcount_test.c

index c4f7c2e33518265d51b2344cc1c0b687db9312cf..86d44ef845d140a7dd8f40866917d799f7338774 100644 (file)
@@ -132,7 +132,7 @@ static const char *smb_subop_name(int op, int subop)
 {
        /* trans */
        if (op == 0x25) {
-               if (subop > sizeof(trans_subop_table) /
+               if (subop >= sizeof(trans_subop_table) /
                    sizeof(trans_subop_table[0])) {
                        return "unknown";
                }