From 705df89c6d82654dcd4ba39ac0c0b717a302829e Mon Sep 17 00:00:00 2001 From: Hermet Park Date: Thu, 1 Jul 2021 17:38:34 +0900 Subject: [PATCH] common array: -- sanitizer errors runtime error: null pointer passed as argument 1, which is declared to never be null @Issue: https://github.com/Samsung/thorvg/issues/543 Change-Id: I4a584f715cc71a7c0aeca921586e6b8f1fa1a7fe --- src/lib/tvgArray.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/tvgArray.h b/src/lib/tvgArray.h index e1f494b..c254047 100644 --- a/src/lib/tvgArray.h +++ b/src/lib/tvgArray.h @@ -75,7 +75,7 @@ struct Array void operator=(const Array& rhs) { reserve(rhs.count); - memcpy(data, rhs.data, sizeof(T) * reserved); + if (rhs.count > 0) memcpy(data, rhs.data, sizeof(T) * reserved); count = rhs.count; } -- 2.7.4