[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gcl-devel] [PATCH 06/11] Check for preceding NULL in find_init_name1
From: |
Will Newton |
Subject: |
[Gcl-devel] [PATCH 06/11] Check for preceding NULL in find_init_name1 |
Date: |
Wed, 11 Jun 2014 17:27:19 +0100 |
From: Will Newton <address@hidden>
The current approach will find a function name like
"fSinit_function" and return "init_function" which is not what
we want. Check that the found function name is preceded by a NULL
to avoid this.
---
gcl/o/cmpaux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gcl/o/cmpaux.c b/gcl/o/cmpaux.c
index bbeaf35..6c41ab7 100644
--- a/gcl/o/cmpaux.c
+++ b/gcl/o/cmpaux.c
@@ -701,7 +701,7 @@ find_init_name1(char *s,unsigned len) {
if (fread(tmp,1,ss.st_size,f)!=ss.st_size)
FEerror("Error reading binary file",0);
fclose(f);
- for (s=tmp;s<tmp+ss.st_size &&
strncmp(s,"init_",5);q=strstr(s+1,"init_"),s=q ? q : s+strlen(s)+1);
+ for (s=tmp+1;s<tmp+ss.st_size && (strncmp(s,"init_",5) || s[-1] !=
'\0');q=strstr(s+1,"init_"),s=q ? q : s+strlen(s)+1);
if (strncmp(s,"init_",5))
FEerror("Init name not found",0);
return make_simple_string(s);
--
1.9.3
- [Gcl-devel] [PATCH 00/11] Add support for AArch64, Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 01/11] config.{sub, guess}: Update to latest versions of GNU config, Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 03/11] Add support for AArch64, Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 04/11] Reorder code to avoid problems with dis-asm.h defining DEFUN., Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 02/11] o/main.c: Ensure cs_org is always pointer aligned, Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 06/11] Check for preceding NULL in find_init_name1,
Will Newton <=
- [Gcl-devel] [PATCH 07/11] Fix handling of varargs in sSuniversal_error_handler, Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 05/11] Always pass a va_list as the last arg of call_proc_new, Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 10/11] Reduce threshold for increasing maxpage, Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 09/11] Avoid looking up dynamic symbols in the executable, Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 08/11] Handle dladdr failure correctly, Will Newton, 2014/06/11
- [Gcl-devel] [PATCH 11/11] Hack to disable x86 floating point code, Will Newton, 2014/06/11
- Re: [Gcl-devel] [PATCH 00/11] Add support for AArch64, Camm Maguire, 2014/06/11