Commit 101419b1 authored by Alan Coopersmith's avatar Alan Coopersmith Committed by Ulrich Sibiller

_XkbReadGeomOverlay: check for NULL first, then use pointer

Flagged by cppcheck 1.62: [lib/libX11/nx-X11/lib/X11/XKBGeom.c:479] -> [lib/libX11/nx-X11/lib/X11/XKBGeom.c:480]: (warning) Possible null pointer dereference: row - otherwise it is redundant to check it against null. Signed-off-by: 's avatarAlan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent 1b0df5da
...@@ -476,9 +476,9 @@ _XkbReadGeomOverlay(XkbReadBufferPtr buf, ...@@ -476,9 +476,9 @@ _XkbReadGeomOverlay(XkbReadBufferPtr buf,
if (rowWire == NULL) if (rowWire == NULL)
return BadLength; return BadLength;
row = XkbAddGeomOverlayRow(ol, rowWire->rowUnder, rowWire->nKeys); row = XkbAddGeomOverlayRow(ol, rowWire->rowUnder, rowWire->nKeys);
row->row_under = rowWire->rowUnder;
if (!row) if (!row)
return BadAlloc; return BadAlloc;
row->row_under = rowWire->rowUnder;
if (rowWire->nKeys < 1) if (rowWire->nKeys < 1)
continue; continue;
keyWire = (xkbOverlayKeyWireDesc *) keyWire = (xkbOverlayKeyWireDesc *)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment