Bug 204253 - usr/src/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c:319: bad if test ?
Summary: usr/src/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c:319: bad...
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: Andriy Voskoboinyk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-03 15:31 UTC by David Binderman
Modified: 2019-03-04 03:40 UTC (History)
1 user (show)

See Also:
avos: mfc-stable12+
avos: mfc-stable11+
avos: mfc-stable10+


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Binderman 2015-11-03 15:31:48 UTC
[usr/src/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c:319]: (warning) Char literal compared with pointer 'chunk_name'. Did you intend to dereference it?

Source code is

    if (chunk_name == NULL || chunk_name == '\0')

Maybe better code

    if (chunk_name == NULL || chunk_name[0] == '\0')
Comment 1 commit-hook freebsd_committer freebsd_triage 2019-02-18 03:23:38 UTC
A commit references this bug:

Author: avos
Date: Mon Feb 18 03:23:11 UTC 2019
New revision: 344245
URL: https://svnweb.freebsd.org/changeset/base/344245

Log:
  snmp_hostres(3): fix a typo in sanity checks in handle_chunk()

  PR:		204253
  Submitted by:	David Binderman <dcb314@hotmail.com>
  MFC after:	5 days

Changes:
  head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2019-03-04 03:39:17 UTC
A commit references this bug:

Author: avos
Date: Mon Mar  4 03:38:44 UTC 2019
New revision: 344747
URL: https://svnweb.freebsd.org/changeset/base/344747

Log:
  MFC r344245:
  snmp_hostres(3): fix a typo in sanity checks in handle_chunk()

  PR:		204253
  Submitted by:	David Binderman <dcb314@hotmail.com>

Changes:
_U  stable/10/
  stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
_U  stable/11/
  stable/11/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
_U  stable/12/
  stable/12/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c