• E
    conf: tighten up XML integer parsing · c09acad3
    Eric Blake 提交于
    https://bugzilla.redhat.com/show_bug.cgi?id=617711 reported that
    even with my recent patched to allow <memory unit='G'>1</memory>,
    people can still get away with trying <memory>1G</memory> and
    silently get <memory unit='KiB'>1</memory> instead.  While
    virt-xml-validate catches the error, our C parser did not.
    
    Not to mention that it's always fun to fix bugs while reducing
    lines of code.  :)
    
    * src/conf/domain_conf.c (virDomainParseMemory): Check for parse error.
    (virDomainDefParseXML): Avoid strtoll.
    * src/conf/storage_conf.c (virStorageDefParsePerms): Likewise.
    * src/util/xml.c (virXPathLongBase, virXPathULongBase)
    (virXPathULongLong, virXPathLongLong): Likewise.
    c09acad3
storage_conf.c 51.1 KB