aboutsummaryrefslogtreecommitdiff
path: root/pb_encode.c
diff options
context:
space:
mode:
Diffstat (limited to 'pb_encode.c')
-rw-r--r--pb_encode.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/pb_encode.c b/pb_encode.c
index 0f89d98..be82510 100644
--- a/pb_encode.c
+++ b/pb_encode.c
@@ -304,6 +304,12 @@ static bool pb_check_proto3_default_value(const pb_field_t *field, const void *p
return true;
}
}
+
+ /* Compares pointers to NULL in case of FT_POINTER */
+ if (PB_ATYPE(type) == PB_ATYPE_POINTER && PB_LTYPE(type) > PB_LTYPE_LAST_PACKABLE)
+ {
+ return !*(const void**)((uintptr_t)pData);
+ }
{
/* Catch-all branch that does byte-per-byte comparison for zero value.