-
Notifications
You must be signed in to change notification settings - Fork 47
Open
Description
Desctiption
When I used the bitstr_tell function to handle a specific input, a segmentation fault (SEGV) was triggered at fbitstr_tell in bitstr.c
Lines 233 to 243 in caade60
| long bitstr_tell(void *stream) | |
| { | |
| int type; | |
| if (!stream) return EOF; | |
| type = *(int*)stream; | |
| switch (type) { | |
| case BITSTR_MEM : return mbitstr_tell(stream); | |
| case BITSTR_FILE: return fbitstr_tell(stream); | |
| } | |
| return EOF; | |
| } |
Lines 149 to 154 in caade60
| static long fbitstr_tell(void *stream) | |
| { | |
| FBITSTR *context = (FBITSTR*)stream; | |
| if (!context || !context->fp) return EOF; | |
| return ftell(context->fp); | |
| } |
Test Environment
Ubuntu 22.04.1, 64bit
ffjpeg(master caade60)
program source file
How to trigger
Download the poc file , program and run the following cmd:
$ ./fbitstr_tell ./poc
Detail
GDB report
(gdb) r
Starting program: /data/ambrose/output/ffjpeg_temperature_test/ffjpeg_deepseek/crashes/bitstr.c/bitstr_tell/fbitstr_tell/fbitstr_tell output/default/crashes/id:000000,sig:11,src:000006,time:629165,execs:433715,op:havoc,rep:1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff7c7fd4d in __GI__IO_ftell (fp=0x3030303030303030) at ./libio/ioftell.c:37
37 ./libio/ioftell.c: No such file or directory.
(gdb) bt
#0 0x00007ffff7c7fd4d in __GI__IO_ftell (fp=0x3030303030303030) at ./libio/ioftell.c:37
#1 0x000055555555597d in fbitstr_tell ()
#2 0x0000555555555c3f in bitstr_tell ()
#3 0x0000555555555498 in main (argc=2, argv=0x7fffffffdc78)
at /home/ambrose/vsproject/HIMFuzz/harness/output/ffjpeg_deepseek/harness/code/bitstr.c/bitstr_tell/fbitstr_tell.c:36
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels