Fix off-by-one error in index check in xkb_file_type_to_string
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Sun, 30 Sep 2018 23:04:29 +0000 (16:04 -0700)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Sun, 30 Sep 2018 23:04:29 +0000 (16:04 -0700)
commit31f1f355700870c6615399fbfa7934934b3a9a57
tree1d0bef3eca04a2a3fe7917d8450fa7c486be70f0
parentc9a499c9c9b8aec88c8ba1a1f58fb86c3bb15d5d
Fix off-by-one error in index check in xkb_file_type_to_string

Found by Oracle's Parfait 2.2 static analyzer:
Error: Buffer overrun
   Read outside array bounds [read-outside-array-bounds] (CWE 125):
      In array dereference of xkb_file_type_strings[type] with index type
      Array size is 56 bytes, index <= 56
        at line 734 of src/xkbcomp/ast-build.c in function 'xkb_file_type_to_string'.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
src/xkbcomp/ast-build.c