mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-05 09:58:10 +02:00
ximcp: Address warning found by UBSan when growing an empty tree
imLcPrs.c:681:52: runtime error: applying zero offset to null pointer Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
parent
7f7bcd7b6f
commit
496d9bfeed
1 changed files with 1 additions and 1 deletions
|
|
@ -678,7 +678,7 @@ parseline(
|
|||
b->treesize = newsize;
|
||||
/* Re-derive top after realloc() to avoid undefined behaviour
|
||||
(and crashes on architectures that track pointer bounds). */
|
||||
if (top >= (DTIndex *) old && top < (DTIndex *) &old[oldsize])
|
||||
if (old && top >= (DTIndex *) old && top < (DTIndex *) &old[oldsize])
|
||||
top = (DTIndex *) (((char *)new) + (((char *)top)-(char *)old));
|
||||
}
|
||||
p = &b->tree[b->treeused];
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue