Fix NULL crash & integer overflow

This commit is contained in:
Daniel P. Berrange 2008-12-07 20:45:28 +00:00
parent 5abce0805b
commit 73bc9c163c
2 changed files with 6 additions and 2 deletions

View File

@ -1,3 +1,7 @@
Sun Dec 7 20:44:53 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
* src/test.c: Fix integer long long overflow. Fix NULL defernce
Sun Dec 7 20:20:53 GMT 2008 Daniel P. Berrange <berrange@redhat.com> Sun Dec 7 20:20:53 GMT 2008 Daniel P. Berrange <berrange@redhat.com>
* src/test.c: Remove bogus refresh call causing deadlock * src/test.c: Remove bogus refresh call causing deadlock

View File

@ -191,7 +191,7 @@ static const char *defaultPoolXML =
" </target>" " </target>"
"</pool>"; "</pool>";
static const unsigned long long defaultPoolCap = (100 * 1024 * 1024 * 1024ul); static const unsigned long long defaultPoolCap = (100 * 1024 * 1024 * 1024ull);
static const unsigned long long defaultPoolAlloc = 0; static const unsigned long long defaultPoolAlloc = 0;
static int testStoragePoolObjSetDefaults(virStoragePoolObjPtr pool); static int testStoragePoolObjSetDefaults(virStoragePoolObjPtr pool);
@ -2997,10 +2997,10 @@ testStorageVolumeCreateXML(virStoragePoolPtr pool,
privpool->def->allocation); privpool->def->allocation);
privpool->volumes.objs[privpool->volumes.count++] = privvol; privpool->volumes.objs[privpool->volumes.count++] = privvol;
privvol = NULL;
ret = virGetStorageVol(pool->conn, privpool->def->name, ret = virGetStorageVol(pool->conn, privpool->def->name,
privvol->name, privvol->key); privvol->name, privvol->key);
privvol = NULL;
cleanup: cleanup:
virStorageVolDefFree(privvol); virStorageVolDefFree(privvol);