Re: [libvirt] [PATCH 6/7] xend_internal.c: assure clang that we do not dereference NULL

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Apr 14, 2010 at 06:02:35PM +0200, Jim Meyering wrote:
> From: Jim Meyering <meyering@xxxxxxxxxx>
> 
> * 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 |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/src/xen/xend_internal.c b/src/xen/xend_internal.c
> index c4e73b7..950f1b5 100644
> --- a/src/xen/xend_internal.c
> +++ b/src/xen/xend_internal.c
> @@ -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)

ACK


Daniel
-- 
|: Red Hat, Engineering, London    -o-   http://people.redhat.com/berrange/ :|
|: http://libvirt.org -o- http://virt-manager.org -o- http://deltacloud.org :|
|: http://autobuild.org        -o-         http://search.cpan.org/~danberr/ :|
|: GnuPG: 7D3B9505  -o-   F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list

[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]