Avoid NULL pointer dereference in xf86TokenToOptinfo if token not found
authorAlan Coopersmith <alan.coopersmith@oracle.com>
Sun, 27 Jan 2013 21:50:30 +0000 (13:50 -0800)
committerAlan Coopersmith <alan.coopersmith@oracle.com>
Wed, 6 Feb 2013 02:34:26 +0000 (18:34 -0800)
commit08f75d3a9661c6c32800e1b4f150626200b889d9
tree00227bb09a3ae0528cf765dc28290e1483199c17
parentc1c01e350834a23161b33bd34b2fa9c01d02a65b
Avoid NULL pointer dereference in xf86TokenToOptinfo if token not found

Reported by parfait 1.1 code analyzer:

Error: Null pointer dereference (CWE 476)
   Read from null pointer 'p'
        at line 746 of hw/xfree86/common/xf86Option.c in function 'xf86TokenToOptName'.
          Function 'xf86TokenToOptinfo' may return constant 'NULL' at line 721, called at line 745.
          Null pointer introduced at line 721 in function 'xf86TokenToOptinfo'.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
hw/xfree86/common/xf86Option.c