From 8db2ae8e7ddb04f5b0c201071096196c6ff4e52b Mon Sep 17 00:00:00 2001 From: fumiama Date: Tue, 8 Jun 2021 14:55:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=AE=B5=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protobuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/protobuf.c b/protobuf.c index 1fac389..fd64d2c 100644 --- a/protobuf.c +++ b/protobuf.c @@ -37,7 +37,7 @@ SIMPLE_PB* get_pb(FILE* fp) { uint32_t init_pos = ftell(fp); uint32_t struct_len = read_num(fp); if(struct_len > 1) { - SIMPLE_PB* spb = malloc(struct_len + sizeof(uint32_t)); + SIMPLE_PB* spb = malloc(struct_len + 2 * sizeof(uint32_t)); if(spb) { spb->struct_len = struct_len; spb->real_len = 0;