This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug glob/24607] Segmentation Fault in Glob with invalid path


https://sourceware.org/bugzilla/show_bug.cgi?id=24607

--- Comment #2 from Jonathan Cottrill <sourceware at jonathancottrill dot net> ---
I'm able to reproduce this in Ubuntu 19.04, glibc 2.29, inside a Docker
container, using these steps:

docker run --rm -it --privileged ubuntu:19.04

Inside the container:

apt update && apt install -y gcc gdb
cat >glob.c <<<'
#include <glob.h>
#include <stddef.h>

int main() {
    glob_t g;
   
glob("//*/.*//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////./.**",
      8198, NULL, &g);

    return 0;
}
'
gcc -o glob glob.c
gdb -ex run glob

Output is similar to screenshot Nicholas Starke posted:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7ec0984 in __glob (pattern=pattern@entry=0x7fffff7ff300 "//*/.*",
'/' <repeats 194 times>..., flags=flags@entry=8198, errfunc=errfunc@entry=0x0,
pglob=pglob@entry=0x7fffffffcfd0) at ../posix/glob.c:289

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]