From d1e0dc62752d3dd0ed7909cda6a4380e2ab8695b Mon Sep 17 00:00:00 2001 From: Vadim Girlin Date: Fri, 24 May 2013 16:24:09 +0400 Subject: [PATCH] r600g/sb: fix buffer overflow in sb_ostream Fixes segfault during bytecode dump with bfgminer kernel Signed-off-by: Vadim Girlin --- src/gallium/drivers/r600/sb/sb_bc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/sb/sb_bc.h b/src/gallium/drivers/r600/sb/sb_bc.h index 8b932634c55..6e73b418d23 100644 --- a/src/gallium/drivers/r600/sb/sb_bc.h +++ b/src/gallium/drivers/r600/sb/sb_bc.h @@ -92,7 +92,7 @@ public: sb_ostream& operator <<(double d) { char b[32]; - sprintf(b, "%f", d); + snprintf(b, 32, "%g", d); return *this << b; } -- 2.30.2