Skip to content

Commit

Permalink
Fix stack buffer overflow in teststringformat.c (#133)
Browse files Browse the repository at this point in the history
Found with asan

Also clean up some ifdefs
  • Loading branch information
hughbe authored and akoeplinger committed Nov 23, 2017
1 parent fb0d0ba commit 362f267
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/teststringformat.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#endif
#endif

#if defined(_WIN32)
#if defined(USE_WINDOWS_GDIPLUS)
#include <Windows.h>
#include <GdiPlus.h>

Expand All @@ -18,7 +18,7 @@
#include <stdlib.h>
#include "testhelpers.h"

#ifdef WIN32
#ifdef USE_WINDOWS_GDIPLUS
using namespace Gdiplus;
using namespace DllExports;
#endif
Expand Down Expand Up @@ -594,7 +594,7 @@ static void test_setStringFormatMeasurableCharacterRanges ()
{
GpStatus status;
GpStringFormat *format;
CharacterRange ranges[1];
CharacterRange ranges[3];
INT measurableCharacterRangeCount;

GdipCreateStringFormat (10, 11, &format);
Expand Down

0 comments on commit 362f267

Please sign in to comment.