aboutsummaryrefslogtreecommitdiffstats
path: root/pb.h
diff options
context:
space:
mode:
authorPetteri Aimonen <jpa@git.mail.kapsi.fi>2015-01-11 19:46:15 +0200
committerPetteri Aimonen <jpa@git.mail.kapsi.fi>2015-01-11 19:46:15 +0200
commitd2e023e3e5ef888e176292f149d1ba93ba270c94 (patch)
tree0670534d7f96dfaa1db888af656416b0969f72fc /pb.h
parent8d12fecc7e4fb6899eb0d013abe0d6a5e03447ce (diff)
Bugfixes for oneof support.
Fixes crashes / memory leaks when using pointer type fields. Also fixes initialization of which_oneof fields.
Diffstat (limited to 'pb.h')
-rw-r--r--pb.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/pb.h b/pb.h
index af58dca..fc846c9 100644
--- a/pb.h
+++ b/pb.h
@@ -514,7 +514,7 @@ struct pb_extension_s {
#define PB_ONEOF_POINTER(u, tag, st, m, fd, ltype, ptr) \
{tag, PB_ATYPE_POINTER | PB_HTYPE_ONEOF | ltype, \
fd, pb_delta(st, which_ ## u, u.m), \
- pb_membersize(st, u.m), 0, ptr}
+ pb_membersize(st, u.m[0]), 0, ptr}
#define PB_ONEOF_FIELD(union_name, tag, type, rules, allocation, placement, message, field, prevfield, ptr) \
PB_ ## rules ## _ ## allocation(union_name, tag, message, field, \