Security review (#331)

* Fix some issues

* add typed_data.c changes

* Make attribution after the check
This commit is contained in:
Jorge Martins
2022-08-08 13:53:41 +02:00
committed by GitHub
parent ff68de5bb7
commit b2ec3eff0a
7 changed files with 43 additions and 4 deletions

View File

@@ -21,10 +21,10 @@ static s_path *path_struct = NULL;
*
* @param[out] fields_count_ptr the number of fields in the last evaluated depth
* @param[in] n the number of depths to evaluate
* @return the feld which the first Nth depths points to
* @return the field which the first Nth depths points to
*/
static const void *get_nth_field(uint8_t *const fields_count_ptr, uint8_t n) {
const void *struct_ptr = path_struct->root_struct;
const void *struct_ptr = NULL;
const void *field_ptr = NULL;
const char *typename;
uint8_t length;
@@ -33,6 +33,9 @@ static const void *get_nth_field(uint8_t *const fields_count_ptr, uint8_t n) {
if (path_struct == NULL) {
return NULL;
}
struct_ptr = path_struct->root_struct;
if (n > path_struct->depth_count) // sanity check
{
return NULL;