You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by sz...@apache.org on 2021/05/26 12:46:21 UTC

[nifi-minifi-cpp] 13/17: avoid undefined behavior (std::string(nullptr)) in LuaBaseStream::read

This is an automated email from the ASF dual-hosted git repository.

szaszm pushed a commit to branch MINIFICPP-1507
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git

commit 4fc6ef141ba1bc1c81b6cf7fe6cf73a6bfb2baf6
Author: Marton Szasz <sz...@gmail.com>
AuthorDate: Thu Mar 18 15:26:35 2021 +0100

    avoid undefined behavior (std::string(nullptr)) in LuaBaseStream::read
---
 extensions/script/lua/LuaBaseStream.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/extensions/script/lua/LuaBaseStream.cpp b/extensions/script/lua/LuaBaseStream.cpp
index 883a13c..3545c77 100644
--- a/extensions/script/lua/LuaBaseStream.cpp
+++ b/extensions/script/lua/LuaBaseStream.cpp
@@ -39,7 +39,7 @@ std::string LuaBaseStream::read(size_t len) {
   }
 
   if (len <= 0) {
-    return nullptr;
+    return std::string{};
   }
 
   std::string buffer;