]> git.ipfire.org Git - thirdparty/libvirt.git/commit
storage: avoid crash on parse error
authorEric Blake <eblake@redhat.com>
Mon, 4 Jul 2011 02:41:38 +0000 (10:41 +0800)
committerDaniel Veillard <veillard@redhat.com>
Mon, 4 Jul 2011 02:41:38 +0000 (10:41 +0800)
commit5dc404b71d15d214926eb259a3700a8206dd2838
tree245cbddb4bd373a680a74efb4ee67cee39647d91
parent222f6233b4f441b8e70194f21c574d03f16df3f8
storage: avoid crash on parse error

Coverity detected that we could crash on bogus input.  Meanwhile,
strtok_r is rather heavy compared to strchr.

* src/storage/storage_backend_iscsi.c (virStorageBackendIQNFound):
  Check for parse failure, and use lighter-weight functions.
src/storage/storage_backend_iscsi.c