mirror of
https://gitlab.com/qemu-project/openbios.git
synced 2024-02-13 08:34:06 +08:00
Commit revised version of Igor Kovalenko's patch for detecting whether dictionary allocations have overrun the memory
buffer allocated for them. Signed-off-by: Igor V. Kovalenko <igor.v.kovalenko@gmail.com> Signed-off-by: Mark Cave-Ayland <mark.cave-ayland@siriusit.co.uk> git-svn-id: svn://coreboot.org/openbios/trunk/openbios-devel@741 f158a5a8-5612-0410-a976-696ce0be7e32
This commit is contained in:
committed by
Mark Cave-Ayland
parent
2f18dff299
commit
2d74db1de3
@@ -19,7 +19,8 @@
|
||||
|
||||
void boot(void);
|
||||
|
||||
static char intdict[256 * 1024];
|
||||
#define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */
|
||||
static char intdict[DICTIONARY_SIZE];
|
||||
|
||||
static void init_memory(void)
|
||||
{
|
||||
@@ -63,6 +64,8 @@ int openbios(void)
|
||||
collect_sys_info(&sys_info);
|
||||
|
||||
dict=intdict;
|
||||
dictlimit = DICTIONARY_SIZE;
|
||||
|
||||
load_dictionary((char *)sys_info.dict_start,
|
||||
sys_info.dict_end-sys_info.dict_start);
|
||||
|
||||
|
||||
@@ -83,6 +83,8 @@ int
|
||||
initialize_forth( void )
|
||||
{
|
||||
dict = malloc(DICTIONARY_SIZE);
|
||||
dictlimit = DICTIONARY_SIZE;
|
||||
|
||||
load_dictionary( forth_dictionary, sizeof(forth_dictionary) );
|
||||
|
||||
PUSH_xt( bind_noname_func(arch_of_init) );
|
||||
|
||||
@@ -185,6 +185,8 @@ int openbios(void)
|
||||
collect_sys_info(&sys_info);
|
||||
|
||||
dict = malloc(DICTIONARY_SIZE);
|
||||
dictlimit = DICTIONARY_SIZE;
|
||||
|
||||
load_dictionary((char *)sys_info.dict_start,
|
||||
(unsigned long)sys_info.dict_end
|
||||
- (unsigned long)sys_info.dict_start);
|
||||
|
||||
@@ -519,6 +519,8 @@ int openbios(void)
|
||||
collect_sys_info(&sys_info);
|
||||
|
||||
dict = malloc(DICTIONARY_SIZE);
|
||||
dictlimit = DICTIONARY_SIZE;
|
||||
|
||||
load_dictionary((char *)sys_info.dict_start,
|
||||
(unsigned long)sys_info.dict_end
|
||||
- (unsigned long)sys_info.dict_start);
|
||||
|
||||
@@ -485,6 +485,7 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
|
||||
dictlimit = DICTIONARY_SIZE;
|
||||
memset(dict, 0, DICTIONARY_SIZE);
|
||||
|
||||
if (!segfault) {
|
||||
|
||||
@@ -22,7 +22,8 @@
|
||||
void boot(void);
|
||||
void collect_sys_info(struct sys_info *info);
|
||||
|
||||
static unsigned char intdict[256 * 1024];
|
||||
#define DICTIONARY_SIZE (256*1024) /* 256K for the dictionary */
|
||||
static unsigned char intdict[DICTIONARY_SIZE];
|
||||
|
||||
#ifdef CONFIG_DRIVER_PCI
|
||||
static const pci_arch_t default_pci_host = {
|
||||
@@ -86,6 +87,8 @@ int openbios(void)
|
||||
collect_sys_info(&sys_info);
|
||||
|
||||
dict=intdict;
|
||||
dictlimit = DICTIONARY_SIZE;
|
||||
|
||||
load_dictionary((char *)sys_info.dict_start,
|
||||
(unsigned long)sys_info.dict_end -
|
||||
(unsigned long)sys_info.dict_start);
|
||||
|
||||
Reference in New Issue
Block a user