From 2130d5daa61e2a3e998d879f6ab3852838385f86 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 6 Feb 2016 09:41:27 +0100 Subject: [PATCH] proplib/prop_data: avoid 0 sized allocation reported by clang-analyzer. --- lib/portableproplib/prop_data.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/portableproplib/prop_data.c b/lib/portableproplib/prop_data.c index 4d0ae2ce..e743438b 100644 --- a/lib/portableproplib/prop_data.c +++ b/lib/portableproplib/prop_data.c @@ -565,8 +565,8 @@ _prop_data_internalize(prop_stack_t stack, prop_object_t *obj, NULL) == false) return (true); - if (len + 1 >= SIZE_MAX) - return true; + if (len >= SIZE_MAX) + len = 1; /* * Always allocate one extra in case we don't land on an even byte * boundary during the decode.