diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2013-03-03 17:53:43 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-03-03 20:18:23 -0800 |
commit | 01291929582ac573d7efd7fba3dbe061c9d70f9a (patch) | |
tree | cc836d5c2e40d26dd8f39dd5bad6c5193f2ef04d /profile.c | |
parent | 93eeb03d67baac26da4153a163bf35567b106524 (diff) | |
download | subsurface-01291929582ac573d7efd7fba3dbe061c9d70f9a.tar.gz |
Try to capture some more potential buffer overflows caused by localization
A couple of these could clearly cause a crash just like the one fixed by
commit 00865f5a1e1a ("equipment.c: Fix potential buffer overflow in
size_data_funct()").
One would append user input to fixed length buffer without checking.
We were hardcoding the (correct) max path length in macos.c - replaced by
the actual OS constant.
But the vast majority are just extremely generous guesses how long
localized strings could possibly be.
Yes, this commit is likely leaning towards overkill. But we have now been
bitten by buffer overflow crashes twice that were caused by localization,
so I tried to go through all of the code and identify every possible
buffer that could be affected by this.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -268,7 +268,7 @@ static void plot_text(struct graphics_context *gc, const text_render_options_t * cairo_font_extents_t fe; cairo_text_extents_t extents; double dx, dy; - char buffer[80]; + char buffer[256]; va_list args; va_start(args, fmt); @@ -346,7 +346,7 @@ static void plot_one_event(struct graphics_context *gc, struct plot_info *pi, st { int i, depth = 0; int x,y; - char buffer[80]; + char buffer[256]; /* is plotting this event disabled? */ if (event->name) { |