From: Vadim Girlin Date: Fri, 24 May 2013 12:24:09 +0000 (+0400) Subject: r600g/sb: fix buffer overflow in sb_ostream X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d1e0dc62752d3dd0ed7909cda6a4380e2ab8695b;p=mesa.git r600g/sb: fix buffer overflow in sb_ostream Fixes segfault during bytecode dump with bfgminer kernel Signed-off-by: Vadim Girlin --- 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; }