mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-09 14:35:25 +00:00
xend_internal.c: assure clang that we do not dereference NULL
* src/xen/xend_internal.c (xend_parse_sexp_desc_char): Add three uses of sa_assert, each preceding a strchr(value,... to assure clang that "value" is non-NULL.
This commit is contained in:
parent
a0dc452172
commit
18fa9b18bc
@ -1284,6 +1284,7 @@ xend_parse_sexp_desc_char(virBufferPtr buf,
|
|||||||
virBufferVSprintf(buf, " <source path='%s'/>\n",
|
virBufferVSprintf(buf, " <source path='%s'/>\n",
|
||||||
value);
|
value);
|
||||||
} else if (STREQ(type, "tcp")) {
|
} else if (STREQ(type, "tcp")) {
|
||||||
|
sa_assert (value);
|
||||||
const char *offset = strchr(value, ':');
|
const char *offset = strchr(value, ':');
|
||||||
const char *offset2;
|
const char *offset2;
|
||||||
const char *mode, *protocol;
|
const char *mode, *protocol;
|
||||||
@ -1325,6 +1326,7 @@ xend_parse_sexp_desc_char(virBufferPtr buf,
|
|||||||
" <protocol type='%s'/>\n",
|
" <protocol type='%s'/>\n",
|
||||||
protocol);
|
protocol);
|
||||||
} else if (STREQ(type, "udp")) {
|
} else if (STREQ(type, "udp")) {
|
||||||
|
sa_assert (value);
|
||||||
const char *offset = strchr(value, ':');
|
const char *offset = strchr(value, ':');
|
||||||
const char *offset2, *offset3;
|
const char *offset2, *offset3;
|
||||||
|
|
||||||
@ -1383,6 +1385,7 @@ xend_parse_sexp_desc_char(virBufferPtr buf,
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else if (STREQ(type, "unix")) {
|
} else if (STREQ(type, "unix")) {
|
||||||
|
sa_assert (value);
|
||||||
const char *offset = strchr(value, ',');
|
const char *offset = strchr(value, ',');
|
||||||
int dolisten = 0;
|
int dolisten = 0;
|
||||||
if (offset)
|
if (offset)
|
||||||
|
Loading…
Reference in New Issue
Block a user