Skip to content

Network NULL pointer reference when enable net/dhcpv4 debug #9575

@mazhenke

Description

@mazhenke

I found that when I enabled net dhcp debug in prj.conf
CONFIG_NET_DEBUG_APP=y
CONFIG_NET_DEBUG_DHCPV4=y

in function dhcpv4_send_request, when dhcpv4 enter requesting state, the ciaddr is NULL, so the line325

322 NET_DBG("send request dst=%s xid=0x%x ciaddr=%s%s%s timeout=%us",
323 net_sprint_ipv4_addr(server_addr),
324 iface->config.dhcpv4.xid,
325 net_sprint_ipv4_addr(ciaddr),
326 with_server_id ? " +server-id" : "",
327 with_requested_ip ? " +requested-ip" : "",
328 timeout);

will read ip data from NULL pointer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions