mirror of
https://github.com/protobuf-c/protobuf-c.git
synced 2024-12-26 21:04:23 +08:00
Merge pull request #299 from guerital/tag-zero-fix
Check if tag is equal to 0
This commit is contained in:
commit
d712e0c52d
@ -2072,6 +2072,11 @@ parse_tag_and_wiretype(size_t len,
|
||||
unsigned shift = 4;
|
||||
unsigned rv;
|
||||
|
||||
/* 0 is not a valid tag value */
|
||||
if ((data[0] & 0xf8) == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
*wiretype_out = data[0] & 7;
|
||||
if ((data[0] & 0x80) == 0) {
|
||||
*tag_out = tag;
|
||||
|
Loading…
x
Reference in New Issue
Block a user