winedbg: Check buffer for NULL before writing to it

James Hawkins truiken at
Thu Jan 11 03:11:37 CST 2007


We check for NULL buffer everywhere else in this function, so add this
check because a NULL buffer can be supplied.

* Check buffer for NULL before writing to it.

James Hawkins
-------------- next part --------------
diff --git a/programs/winedbg/memory.c b/programs/winedbg/memory.c
index 84f43b0..b51257e 100644
--- a/programs/winedbg/memory.c
+++ b/programs/winedbg/memory.c
@@ -652,7 +652,7 @@ BOOL memory_get_register(DWORD regno, DWORD** value, char* buffer, int len)
                 *value = div->pval;
-            snprintf(buffer, len, div->name);
+            if (buffer) snprintf(buffer, len, div->name);
             return TRUE;

More information about the wine-patches mailing list