-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
include/VBox/com/array.h
- - fixes for null-pointer dereferences.
src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h
- - fixes misused AssertReturn().
src/VBox/VMM/VMMR3/PDMDriver.cpp
- - fixes misused AssertLogRelReturn().
Jung-uk Kim
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQEcBAEBCAAGBQJVA08PAAoJEHyflib82/FGIGkH/ieV0Yhn0uq76MxOmdlWyTRB
cCoXXZYQXXYxM0uk1jpV9CahmmQMU1k1Jr25GfsZuXS2Y0BKpxoJXh1RCkyPhww/
87X0YK+sdoAgx8MzpifcYuJIl5GPXjKNuUhkowuTzPOzhXpeHpc0Flov5JInjGqR
QoTmhj25gOsW7bZjIATJIvPRhJG1fUEEpOr3nPNwE9/5nI6Vp9FbS7+Ykn7AfUHk
OhFFkRQ15Qb5xyIdVNs0O8UhcKrFDFKDnbjgU9lO4bz6BIyUOPeZkBVEAPIwvC9h
l5dhXxckGKVdYPVt+I7aWiYPopBbr3RO6/rlOcYXMkqMugTQcVm1hJyacHNyJNc=
=Ikou
-----END PGP SIGNATURE-----
Index: include/VBox/com/array.h
===================================================================
--- include/VBox/com/array.h (revision 54716)
+++ include/VBox/com/array.h (working copy)
@@ -950,12 +950,12 @@ class SafeArray : public Traits
*/
const T operator[] (size_t aIdx) const
{
- AssertReturn(m.arr != NULL, *((T *)NULL));
- AssertReturn(aIdx < size(), *((T *)NULL));
+ Assert(m.arr != NULL);
+ Assert(aIdx < size());
#ifdef VBOX_WITH_XPCOM
return m.arr[aIdx];
#else
- AssertReturn(m.raw != NULL, *((T *)NULL));
+ Assert(m.raw != NULL);
return m.raw[aIdx];
#endif
}
@@ -1451,8 +1451,8 @@ class SafeConstGUIDArray : public SafeArray<const
*/
const nsID &operator[] (size_t aIdx) const
{
- AssertReturn(m.arr != NULL, **((const nsID * *)NULL));
- AssertReturn(aIdx < size(), **((const nsID * *)NULL));
+ Assert(m.arr != NULL);
+ Assert(aIdx < size());
return *m.arr[aIdx];
}
Index: src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h
===================================================================
--- src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h (revision 54716)
+++ src/VBox/Runtime/common/ldr/ldrELFRelocatable.cpp.h (working copy)
@@ -249,7 +249,7 @@ static int RTLDRELF_NAME(RelocateSectionExecDyn)(P
}
else
{
- AssertReturn(pSym->st_shndx < pModElf->cSyms || pSym->st_shndx == SHN_ABS, ("%#x\n", pSym->st_shndx));
+ AssertMsg(pSym->st_shndx < pModElf->cSyms || pSym->st_shndx == SHN_ABS, ("%#x\n", pSym->st_shndx));
#if ELF_MODE == 64
SymValue = pSym->st_value;
#endif
Index: src/VBox/VMM/VMMR3/PDMDriver.cpp
===================================================================
--- src/VBox/VMM/VMMR3/PDMDriver.cpp (revision 54716)
+++ src/VBox/VMM/VMMR3/PDMDriver.cpp (working copy)
@@ -512,11 +512,7 @@ static int pdmR3DrvMaybeTransformChain(PVM pVM, PP
AssertLogRelRCReturn(rc, rc);
rc = CFGMR3ReplaceSubTree(*ppNode, pBelowThisCopy);
- if (RT_FAILURE(rc))
- {
- CFGMR3RemoveNode(pBelowThis);
- AssertLogRelReturn(("rc=%Rrc\n", rc), rc);
- }
+ AssertLogRelRCReturnStmt(rc, CFGMR3RemoveNode(pBelowThis), rc);
}
}
/*
_______________________________________________
vbox-dev mailing list
[email protected]
https://www.virtualbox.org/mailman/listinfo/vbox-dev