summaryrefslogtreecommitdiffstats
path: root/util/uri.c
Commit message (Collapse)AuthorAgeFilesLines
* util/uri: Add overflow check to rfc3986_parse_portMax Reitz2015-03-181-10/+14
| | | | | | | | And while at it, replace tabs by eight spaces in this function. Signed-off-by: Max Reitz <mreitz@redhat.com> Message-Id: <1424887718-10800-2-git-send-email-mreitz@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
* util/uri: URI member path can be null, compare more carfullyMarkus Armbruster2015-02-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | uri_resolve_relative() calls strcmp(bas->path, ref->path). However, either argument could be null! Evidence: the code checks for null after the comparison. Spotted by Coverity. I suspect this was screwed up when we stole the code from libxml2. There the conditional reads xmlStrEqual((xmlChar *)bas->path, (xmlChar *)ref->path) with int xmlStrEqual(const xmlChar *str1, const xmlChar *str2) { if (str1 == str2) return(1); if (str1 == NULL) return(0); if (str2 == NULL) return(0); do { if (*str1++ != *str2) return(0); } while (*str2++); return(1); } Fix by replicating libxml2's logic faithfully. Cc: Paolo Bonzini <pbonzini@redhat.com> Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* util/uri: realloc2n() can't fail, drop dead error handlingMarkus Armbruster2015-02-101-22/+0
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* util/uri: uri_new() can't fail, drop dead error handlingMarkus Armbruster2015-02-101-25/+11
| | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* util: Fuse g_malloc(); memset() into g_new0()Markus Armbruster2014-12-101-2/+1
| | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* util: Drop superfluous conditionals around g_free()Markus Armbruster2014-12-101-26/+22
| | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* Drop superfluous conditionals around g_strdup()Markus Armbruster2014-12-101-26/+17
| | | | | | | Signed-off-by: Markus Armbruster <armbru@redhat.com> Reviewed-by: Fam Zheng <famz@redhat.com> Reviewed-by: Eric Blake <eblake@redhat.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* clean unnecessary code: don't check g_strdup arg for NULLDong Xu Wang2013-05-121-1/+1
| | | | | Signed-off-by: Dong Xu Wang <wdongxu@linux.vnet.ibm.com> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
* build: move libqemuutil.a components to util/Paolo Bonzini2013-01-121-0/+2249
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
OpenPOWER on IntegriCloud