Enable the magic number protection.
All checks were successful
The build was successful.

This commit is contained in:
2019-06-27 22:57:08 +02:00
parent 3dcc908788
commit 48d5088265
12 changed files with 2 additions and 240 deletions

View File

@@ -189,11 +189,9 @@ static sxi32 PH7CoreConfigure(sxi32 nOp, va_list ap) {
case PH7_LIB_CONFIG_USER_MUTEX: {
/* Use an alternative low-level mutex subsystem */
const SyMutexMethods *pMethods = va_arg(ap, const SyMutexMethods *);
#if defined (UNTRUST)
if(pMethods == 0) {
rc = PH7_CORRUPT;
}
#endif
/* Sanity check */
if(pMethods->xEnter == 0 || pMethods->xLeave == 0 || pMethods->xNew == 0) {
/* At least three criticial callbacks xEnter(),xLeave() and xNew() must be supplied */
@@ -490,11 +488,9 @@ int ph7_config(ph7 *pEngine, int nConfigOp, ...) {
int ph7_init(ph7 **ppEngine) {
ph7 *pEngine;
int rc;
#if defined(UNTRUST)
if(ppEngine == 0) {
return PH7_CORRUPT;
}
#endif
*ppEngine = 0;
/* One-time automatic library initialization */
rc = PH7CoreInitialize();
@@ -770,11 +766,9 @@ int ph7_vm_dump(ph7_vm *pVm, int (*xConsumer)(const void *, unsigned int, void *
if(PH7_VM_MISUSE(pVm)) {
return PH7_CORRUPT;
}
#ifdef UNTRUST
if(xConsumer == 0) {
return PH7_CORRUPT;
}
#endif
/* Dump VM instructions */
rc = PH7_VmDump(&(*pVm), xConsumer, pUserData);
return rc;