The pointer parameter value of the free function may be NULL

Bug #1838001 reported by xiaodonghu on 2019-07-26
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

The function sprint_realloc_objid may return NULL in abnormal case.
So, the function fmtoid and fmtmsg_var may return NULL.

However, in these function log_results log_pdu_header and log_invalid_oid_trees, the tempory value var_str point to the return value of fmtmsg_var may be NULL.

In these function, snmp_log have checked whether var_str is NULL or not, but free doesn't check it.
When the var_str is NULL, free(NULL) will make the program crashed.

So we need to add the checking before free function.

xiaodonghu (xiaodonghu) on 2019-07-26
description: updated
Ghada Khalil (gkhalil) wrote :

Low priority / Not Gating - code cleanup suggestion / no noted system impact

tags: added: stx.fault
Changed in starlingx:
importance: Undecided → Low
assignee: nobody → xiaodonghu (xiaodonghu)
status: New → Triaged
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers