Fix error from clang unsigned overflow sanitizer.
This is actually fully defined behavior, but it still makes sense to cast here.
diff --git a/pb_decode.c b/pb_decode.c
index b36b1a7..de93f8d 100644
--- a/pb_decode.c
+++ b/pb_decode.c
@@ -1546,13 +1546,13 @@
if (!pb_decode_varint32(stream, &size))
return false;
-
+
/* Space for null terminator */
- alloc_size = (size_t)(size + 1);
-
+ alloc_size = (size_t)((size_t)size + 1);
+
if (alloc_size < size)
PB_RETURN_ERROR(stream, "size too large");
-
+
if (PB_ATYPE(field->type) == PB_ATYPE_POINTER)
{
#ifndef PB_ENABLE_MALLOC