[PATCH] setupapi: Avoid debugstr buffer overflow.

Józef Kucia jkucia at codeweavers.com
Sun May 12 08:50:09 CDT 2019


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---

Alternatively, trace TRACE() could be removed.

---
 dlls/setupapi/parser.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/dlls/setupapi/parser.c b/dlls/setupapi/parser.c
index c1086895d0dc..449ae002c55e 100644
--- a/dlls/setupapi/parser.c
+++ b/dlls/setupapi/parser.c
@@ -1857,7 +1857,12 @@ BOOL WINAPI SetupGetBinaryField( PINFCONTEXT context, DWORD index, BYTE *buffer,
     {
         TRACE( "%p/%p/%d/%d index %d returning",
                context->Inf, context->CurrentInf, context->Section, context->Line, index );
-        for (i = index; i < line->nb_fields; i++) TRACE( " %02x", buffer[i - index] );
+        for (i = index; i < line->nb_fields; i++)
+        {
+            TRACE( " %02x", buffer[i - index] );
+            if (i % 100 == 0)
+                TRACE( "\n" );
+        }
         TRACE( "\n" );
     }
     return TRUE;
-- 
2.21.0




More information about the wine-devel mailing list