]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
xend_internal.c: assure clang that we do not dereference NULL
authorJim Meyering <meyering@redhat.com>
Tue, 2 Mar 2010 15:07:30 +0000 (16:07 +0100)
committerJim Meyering <meyering@redhat.com>
Wed, 14 Apr 2010 18:10:19 +0000 (20:10 +0200)
* 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.

src/xen/xend_internal.c

index c4e73b7344c7a95795a31bbb805154d890d69c4b..950f1b5f108a270c1074b801791455dcc5ac7558 100644 (file)
@@ -1284,6 +1284,7 @@ xend_parse_sexp_desc_char(virBufferPtr buf,
         virBufferVSprintf(buf, "      <source path='%s'/>\n",
                           value);
     } else if (STREQ(type, "tcp")) {
+        sa_assert (value);
         const char *offset = strchr(value, ':');
         const char *offset2;
         const char *mode, *protocol;
@@ -1325,6 +1326,7 @@ xend_parse_sexp_desc_char(virBufferPtr buf,
                           "      <protocol type='%s'/>\n",
                           protocol);
     } else if (STREQ(type, "udp")) {
+        sa_assert (value);
         const char *offset = strchr(value, ':');
         const char *offset2, *offset3;
 
@@ -1383,6 +1385,7 @@ xend_parse_sexp_desc_char(virBufferPtr buf,
         }
 
     } else if (STREQ(type, "unix")) {
+        sa_assert (value);
         const char *offset = strchr(value, ',');
         int dolisten = 0;
         if (offset)