Re: [PATCH] Allow for case-insensitive context search if option --ignore-case is given

Hideki IWAMOTO <[email protected]>
Newsgroups gmane.comp.gnu.global.bugs
Message-ID <[email protected]>
Hi.

Your patch includes use-after-free.

$ ef global -i -x --from-here 383:global/global.c main

  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens <[email protected]>
main               86 global/global.c  int main(int, char **);
main               62 gozilla/gozilla.c int main(int, char **);
main               72 gtags/gtags.c    int main(int, char **);
$ ef global -i -x --from-here 383:global/global.c Main

  Electric Fence 2.2.0 Copyright (C) 1987-1999 Bruce Perens <[email protected]>
/usr/bin/ef: line 20: 10847 Segmentation fault      (core dumped) ( export LD_PRELOAD=libefence.so.0.0; exec $* )
$ gdb -q global core.10847
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `global -i -x --from-here 383 global/global.c Main'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /usr/lib64/libefence.so.0.0...done.
Loaded symbols for /usr/lib64/libefence.so.0.0
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
#0  main (argc=Variable "argc" is not available.
) at global.c:854
854                                     db = decide_tag_by_context(gtp->tag, context_file, atoi(context_lineno));

On Fri, 3 Mar 2017 00:19:16 +0100
Fabian Wiget <[email protected]> wrote:

> Hi everybody
> 
> If the option --from-here is specified, the resulting search by context is
> always case-sensitive even if the option --ignore-case is present.
> 
> Example:
> 
> // will find your main function
> global --from-here=25:/path/to/file.c main
> 
> // won't find your main function
> global --from-here=25:/path/to/file.c -i Main
> 
> The attached patch fixes this issue.
> 
> Thank you & best regards
> fabian

-- 
Hideki IWAMOTO <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.