Ver código fonte

Merge pull request #13192 from ghalliday/issue23178

HPCC-23178 Fix Thor memcpy of a 0 length item with nullptr as target

Reviewed-By: Jake Smith <jake.smith@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 5 anos atrás
pai
commit
1a94a9277f
1 arquivos alterados com 1 adições e 1 exclusões
  1. 1 1
      thorlcr/graph/thgraphmaster.cpp

+ 1 - 1
thorlcr/graph/thgraphmaster.cpp

@@ -1054,7 +1054,7 @@ public:
             r->getResultUnicode(MemoryBuffer2IDataVal(result));
             tlen = result.length()/2;
             tgt = (UChar *)malloc(tlen*2);
-            memcpy(tgt, result.toByteArray(), tlen*2);
+            memcpy_iflen(tgt, result.toByteArray(), tlen*2);
         );
     }
     virtual char * getResultVarString(const char * stepname, unsigned sequence) override