Skip to content

Commit

Permalink
Update snmp-ups.c
Browse files Browse the repository at this point in the history
Avoid potential NULL pointer dereference in a debug printout
  • Loading branch information
jimklimov authored Oct 14, 2022
1 parent e843662 commit 5ec273e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/snmp-ups.c
Original file line number Diff line number Diff line change
Expand Up @@ -2294,7 +2294,8 @@ static int base_snmp_template_index(const snmp_info_t *su_info_p)
char test_OID[SU_INFOSIZE];
snmp_info_flags_t template_type = get_template_type(su_info_p->info_type);

upsdebugx(3, "%s: OID template = %s", __func__, su_info_p->OID);
upsdebugx(3, "%s: OID template = %s", __func__,
(su_info_p->OID ? su_info_p->OID : "<null>") );

/* Try to differentiate between template types which may have
* different indexes ; and store it to not redo it again */
Expand Down

0 comments on commit 5ec273e

Please sign in to comment.