wxWidgets / wxWidgets

Cross-Platform C++ GUI Library
https://www.wxwidgets.org/
6.04k stars 1.76k forks source link

Buffer overflow in tex2rtf #9596

Closed wxtrac closed 15 years ago

wxtrac commented 16 years ago

Issue migrated from trac ticket # 9596

component: samples | priority: normal | resolution: fixed | keywords: tex2rtf buffer overflow

2008-06-17 18:24:20: chowette created the issue


When a .tex file contains a very long line with a bad macro, the tex2rtf die due to a buffer overflow.

\badMacro with a very long line ( more than 200 characters after the macro) will crash the tex2rtf or do something very bad like arbitrary code execution!

This is not critical anymore as the project has switched to doxygen docs, but I use the tool to generate the help file of my application.

-( I set this ticket to the 'samples' component, as there is no 'tool'. This tool was removed of svn trunk)*

wxtrac commented 16 years ago

2008-06-17 18:25:11: chowette uploaded file bufferoverflow.patch (0.9 KiB)

correct buffer overflow in error handling code of tex2rft

wxtrac commented 16 years ago

2008-06-21 17:56:13: @vadz changed priority from high to normal

2008-06-21 17:56:13: @vadz changed status from new to confirmed

2008-06-21 17:56:13: @vadz commented

Should be applied after 2.8.8.

I reduce the priority as I'm afraid it's not the only buffer overflow in tex2rtf anyhow.

BTW, why add "..." at the end of the macro buffer? Is it really useful?

wxtrac commented 16 years ago

2008-06-22 22:11:58: chowette commented


Replying to [comment:1 vadz]:

Should be applied after 2.8.8. No problem for me as long it is not forgotten.

I reduce the priority as I'm afraid it's not the only buffer overflow in tex2rtf anyhow. I hope your are wrong, I will try to give a look. Does anybody knows if a static code analyser are powerful enough to detect those errors ?

BTW, why add "..." at the end of the macro buffer? Is it really useful? Mostly cosmetic, but also easier to decipher the error message. But maybe a quote around the user text will be better.

wxtrac commented 15 years ago

2009-01-25 13:48:52: @vadz changed status from confirmed to closed

2009-01-25 13:48:52: @vadz changed resolution from * to fixed*

2009-01-25 13:48:52: @vadz commented

Thanks, finally applied in 58387.