Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix NULL pointer reference #514

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/common/pf_lldp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,10 @@ int pf_lldp_recv (
pf_lldp_peer_info_t peer_data;
int err = 0;

if (net->lldp_mutex == NULL) {
return -1;
}

err = pf_lldp_parse_packet (buf, buf_len, &peer_data);

if (!err)
Expand Down
4 changes: 4 additions & 0 deletions src/ports/linux/pnal_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#include <stdlib.h>
#include <string.h>
#include <unistd.h>

struct pnal_eth_handle
{
Expand Down Expand Up @@ -59,6 +60,9 @@ static void os_eth_task (void * thread_arg)
pnal_buf_t * p = pnal_buf_alloc (PNAL_BUF_MAX_SIZE);
assert (p != NULL);

// Wait to init finish
sleep(1);

while (1)
{
readlen = recv (eth_handle->socket, p->payload, PNAL_BUF_MAX_SIZE, 0);
Expand Down