From 91dfcd5a5d2cb20285504d787ee4a6135303891a Mon Sep 17 00:00:00 2001
From: Jan Breuer <jan.breuer@jaybee.cz>
Date: 周日, 15 5月 2016 20:01:44 +0800
Subject: [PATCH] Fix buffer overflow in SCPI_NumberToStr, SCPI_DoubleToStr and SCPI_FloatToStr

---
 examples/common/scpi-def.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/common/scpi-def.c b/examples/common/scpi-def.c
index d5f71ae..079a846 100644
--- a/examples/common/scpi-def.c
+++ b/examples/common/scpi-def.c
@@ -181,9 +181,9 @@
     const char * data;
     size_t len;
 
-    SCPI_ParamArbitraryBlock(context, &data, &len, FALSE);
-
-    SCPI_ResultArbitraryBlock(context, data, len);
+    if (SCPI_ParamArbitraryBlock(context, &data, &len, FALSE)) {
+        SCPI_ResultArbitraryBlock(context, data, len);
+    }
 
     return SCPI_RES_OK;
 }

--
Gitblit v1.9.1