bug-sed
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#70232: Bug in argument handling may lead to segfault if --debug is p


From: 37
Subject: bug#70232: Bug in argument handling may lead to segfault if --debug is passed after any compile step
Date: Sat, 06 Apr 2024 00:40:08 -0400

Hi,

This affects every version with the --debug flag to my knowledge. Tested on version 4.8. Reasonably simple reproducer is attached. Run with `sed -f repro.sed --debug`.

I believe the root cause is that sed will compile scripts *before* setting the debug flag, which leads to cmd->x.label_name being garbage since next_cmd_entry doesn't zero out the auxiliary data structure. When sed then tries to print the label through debug_print_program at the end of main, a segfault is possible due to the uninitialized read.

Attachment: repro.sed
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]