Explorar el Código

Fix dereference of NULL

See https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=4178

Credit to oss-fuzz
Stefan Profanter hace 7 años
padre
commit
3d9e6434dc
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2 0
      src/ua_types.c

+ 2 - 0
src/ua_types.c

@@ -565,6 +565,8 @@ copySubString(const UA_String *src, UA_String *dst,
 UA_StatusCode
 UA_Variant_copyRange(const UA_Variant *src, UA_Variant *dst,
                      const UA_NumericRange range) {
+    if (!src->type)
+        return UA_STATUSCODE_BADINVALIDARGUMENT;
     bool isScalar = UA_Variant_isScalar(src);
     bool stringLike = isStringLike(src->type);
     UA_Variant arraySrc;