Fix NULL dereference

Fix NULL dereference when handling REJ packets
This commit is contained in:
XANTRONIX Development 2020-08-06 00:35:11 -04:00 committed by XANTRONIX Industrial
parent ea68dc199b
commit 512957dda1

View file

@ -1492,12 +1492,14 @@ static int handle_rej(patty_ax25_server *server,
patty_ax25_sock *sock,
patty_ax25_frame *frame) {
unsigned int i,
end = sock->vs;
end;
if (sock == NULL) {
return 0;
}
end = sock->vs;
if (frame->nr > end) {
end += (sock->mode == PATTY_AX25_SOCK_SABME)? 128: 8;
}