Module: Mesa
Branch: master
Commit: d1e0dc62752d3dd0ed7909cda6a4380e2ab8695b
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=d1e0dc62752d3dd0ed7909cda6a4380e2ab8695b

Author: Vadim Girlin <[email protected]>
Date:   Fri May 24 16:24:09 2013 +0400

r600g/sb: fix buffer overflow in sb_ostream

Fixes segfault during bytecode dump with bfgminer kernel

Signed-off-by: Vadim Girlin <[email protected]>

---

 src/gallium/drivers/r600/sb/sb_bc.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/r600/sb/sb_bc.h 
b/src/gallium/drivers/r600/sb/sb_bc.h
index 8b93263..6e73b41 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;
        }
 

_______________________________________________
mesa-commit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to