Commit 6889c686 authored by Juergen Schmied's avatar Juergen Schmied Committed by Alexandre Julliard

Small fixes, removed asserts.

parent edd77b93
...@@ -35,7 +35,6 @@ ...@@ -35,7 +35,6 @@
#include <fcntl.h> #include <fcntl.h>
#include <sys/fcntl.h> #include <sys/fcntl.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <assert.h>
#include <time.h> #include <time.h>
#include "windef.h" #include "windef.h"
#include "winbase.h" #include "winbase.h"
...@@ -913,13 +912,24 @@ static _w95dkh * _w95_lookup_dkh (_w95creg *creg, int nrLS, int nrMS) ...@@ -913,13 +912,24 @@ static _w95dkh * _w95_lookup_dkh (_w95creg *creg, int nrLS, int nrMS)
_w95dkh * dkh; _w95dkh * dkh;
int i; int i;
rgdb = (_w95rgdb*)((char*)creg+creg->rgdb_off); /* get the beginning of the rgdb datastore */ /* get the beginning of the rgdb datastore */
assert (creg->rgdb_num > nrMS); /* check: requested block < last_block) */ rgdb = (_w95rgdb*)((char*)creg+creg->rgdb_off);
/* check: requested block < last_block) */
if (creg->rgdb_num <= nrMS)
{
ERR("registry file corrupt! requested block no. beyond end.\n");
goto error;
}
/* find the right block */ /* find the right block */
for(i=0; i<nrMS ;i++) for(i=0; i<nrMS ;i++)
{ {
assert(rgdb->id == W95_REG_RGDB_ID); /* check the magic */ if(rgdb->id != W95_REG_RGDB_ID) /* check the magic */
{
ERR("registry file corrupt! bad magic 0x%08lx\n", rgdb->id);
goto error;
}
rgdb = (_w95rgdb*) ((char*)rgdb+rgdb->size); /* find next block */ rgdb = (_w95rgdb*) ((char*)rgdb+rgdb->size); /* find next block */
} }
...@@ -931,7 +941,7 @@ static _w95dkh * _w95_lookup_dkh (_w95creg *creg, int nrLS, int nrMS) ...@@ -931,7 +941,7 @@ static _w95dkh * _w95_lookup_dkh (_w95creg *creg, int nrLS, int nrMS)
dkh = (_w95dkh*)((char*)dkh + dkh->nextkeyoff); /* find next subblock */ dkh = (_w95dkh*)((char*)dkh + dkh->nextkeyoff); /* find next subblock */
} while ((char *)dkh < ((char*)rgdb+rgdb->size)); } while ((char *)dkh < ((char*)rgdb+rgdb->size));
return NULL; error: return NULL;
} }
/****************************************************************************** /******************************************************************************
...@@ -956,7 +966,7 @@ static int _w95_parse_dkv ( ...@@ -956,7 +966,7 @@ static int _w95_parse_dkv (
{ {
name = _strdupnA(dkv->name, dkv->valnamelen+1); name = _strdupnA(dkv->name, dkv->valnamelen+1);
ret = RegSetValueExA(hkey, name, 0, dkv->type, &(dkv->name[dkv->valnamelen]),dkv->valdatalen); ret = RegSetValueExA(hkey, name, 0, dkv->type, &(dkv->name[dkv->valnamelen]),dkv->valdatalen);
if (ret) ERR("RegSetValueEx failed (0x%08lx)\n", ret); if (ret) FIXME("RegSetValueEx returned: 0x%08lx\n", ret);
free (name); free (name);
/* next value */ /* next value */
...@@ -1090,7 +1100,7 @@ static int NativeRegLoadKey( HKEY hkey, char* fn, int level ) ...@@ -1090,7 +1100,7 @@ static int NativeRegLoadKey( HKEY hkey, char* fn, int level )
regf = base; regf = base;
/* hbin block */ /* hbin block */
hbin = (nt_hbin *) ((char *) base + 0x1000); hbin = (nt_hbin*)((char*) base + 0x1000);
if (hbin->id != NT_REG_POOL_BLOCK_ID) if (hbin->id != NT_REG_POOL_BLOCK_ID)
{ {
ERR_(reg)( "%s hbin block invalid\n", fn); ERR_(reg)( "%s hbin block invalid\n", fn);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment