Fix bug in alltypes test case that made fuzzing difficult.
This commit is contained in:
@@ -23,6 +23,7 @@ bool check_alltypes(pb_istream_t *stream, int mode)
|
|||||||
|
|
||||||
/* Fill with garbage to better detect initialization errors */
|
/* Fill with garbage to better detect initialization errors */
|
||||||
memset(&alltypes, 0xAA, sizeof(alltypes));
|
memset(&alltypes, 0xAA, sizeof(alltypes));
|
||||||
|
alltypes.extensions = 0;
|
||||||
|
|
||||||
if (!pb_decode(stream, AllTypes_fields, &alltypes))
|
if (!pb_decode(stream, AllTypes_fields, &alltypes))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -220,6 +220,7 @@ bool check_alltypes(pb_istream_t *stream, int mode)
|
|||||||
|
|
||||||
/* Fill with garbage to better detect initialization errors */
|
/* Fill with garbage to better detect initialization errors */
|
||||||
memset(&alltypes, 0xAA, sizeof(alltypes));
|
memset(&alltypes, 0xAA, sizeof(alltypes));
|
||||||
|
alltypes.extensions = 0;
|
||||||
|
|
||||||
alltypes.req_int32.funcs.decode = &read_varint;
|
alltypes.req_int32.funcs.decode = &read_varint;
|
||||||
alltypes.req_int32.arg = (void*)-1001;
|
alltypes.req_int32.arg = (void*)-1001;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ bool check_alltypes(pb_istream_t *stream, int mode)
|
|||||||
|
|
||||||
/* Fill with garbage to better detect initialization errors */
|
/* Fill with garbage to better detect initialization errors */
|
||||||
memset(&alltypes, 0xAA, sizeof(alltypes));
|
memset(&alltypes, 0xAA, sizeof(alltypes));
|
||||||
|
alltypes.extensions = 0;
|
||||||
|
|
||||||
if (!pb_decode(stream, AllTypes_fields, &alltypes))
|
if (!pb_decode(stream, AllTypes_fields, &alltypes))
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -107,5 +107,7 @@ message AllTypes {
|
|||||||
// Just to make sure that the size of the fields has been calculated
|
// Just to make sure that the size of the fields has been calculated
|
||||||
// properly, i.e. otherwise a bug in last field might not be detected.
|
// properly, i.e. otherwise a bug in last field might not be detected.
|
||||||
required int32 end = 10099;
|
required int32 end = 10099;
|
||||||
|
|
||||||
|
extensions 200 to 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -107,5 +107,7 @@ message AllTypes {
|
|||||||
// Just to make sure that the size of the fields has been calculated
|
// Just to make sure that the size of the fields has been calculated
|
||||||
// properly, i.e. otherwise a bug in last field might not be detected.
|
// properly, i.e. otherwise a bug in last field might not be detected.
|
||||||
required int32 end = 13432099;
|
required int32 end = 13432099;
|
||||||
|
|
||||||
|
extensions 200 to 255;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user