Bruno Jesus : ole32: Avoid a possible null dereference.
Alexandre Julliard
julliard at wine.codeweavers.com
Fri Nov 14 03:22:44 CST 2014
Module: wine
Branch: master
Commit: 959ca6ac0264e5a285d1360598cb813b1956a4cd
URL: http://source.winehq.org/git/wine.git/?a=commit;h=959ca6ac0264e5a285d1360598cb813b1956a4cd
Author: Bruno Jesus <00cpxxx at gmail.com>
Date: Thu Nov 13 22:13:40 2014 -0200
ole32: Avoid a possible null dereference.
---
dlls/ole32/clipboard.c | 10 ++++------
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/dlls/ole32/clipboard.c b/dlls/ole32/clipboard.c
index 6404f36..0c3be3b 100644
--- a/dlls/ole32/clipboard.c
+++ b/dlls/ole32/clipboard.c
@@ -210,13 +210,11 @@ UINT ole_private_data_clipboard_format = 0;
static UINT wine_marshal_clipboard_format;
-static inline char *dump_fmtetc(FORMATETC *fmt)
+static inline const char *dump_fmtetc(FORMATETC *fmt)
{
- static char buf[100];
-
- snprintf(buf, sizeof(buf), "cf %04x ptd %p aspect %x lindex %d tymed %x",
- fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed);
- return buf;
+ if (!fmt) return "(null)";
+ return wine_dbg_sprintf("cf %04x ptd %p aspect %x lindex %d tymed %x",
+ fmt->cfFormat, fmt->ptd, fmt->dwAspect, fmt->lindex, fmt->tymed);
}
/*---------------------------------------------------------------------*
More information about the wine-cvs
mailing list