mirror of
https://gitlab.freedesktop.org/xorg/lib/libxcb.git
synced 2026-05-08 12:28:00 +02:00
xcb_conn: Add a check for NULL to silence a UBSan runtime error
xcb_conn.c:314:60: runtime error: applying zero offset to null pointer Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
parent
33f3dbe369
commit
cb8c70f5a6
1 changed files with 5 additions and 3 deletions
|
|
@ -310,9 +310,11 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count)
|
|||
int cur = (*vector)->iov_len;
|
||||
if(cur > n)
|
||||
cur = n;
|
||||
(*vector)->iov_len -= cur;
|
||||
(*vector)->iov_base = (char *) (*vector)->iov_base + cur;
|
||||
n -= cur;
|
||||
if(cur) {
|
||||
(*vector)->iov_len -= cur;
|
||||
(*vector)->iov_base = (char *) (*vector)->iov_base + cur;
|
||||
n -= cur;
|
||||
}
|
||||
if((*vector)->iov_len)
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue