From 959ca6ac0264e5a285d1360598cb813b1956a4cd Mon Sep 17 00:00:00 2001 From: Bruno Jesus <00cpxxx@gmail.com> Date: Thu, 13 Nov 2014 22:13:40 -0200 Subject: [PATCH] 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 6404f36f5f5..0c3be3b96c2 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); } /*---------------------------------------------------------------------*