Skip to content

Commit

Permalink
out.c: fix SEGFAULT for fl == NULL (flight info)
Browse files Browse the repository at this point in the history
  • Loading branch information
wiedehopf committed Apr 27, 2023
1 parent d3270f7 commit 62f3c39
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions out.c
Original file line number Diff line number Diff line change
Expand Up @@ -546,15 +546,16 @@ void out(msgblk_t * blk, unsigned char *hdata, int l)

vout( "%s from ", rep ? "Response" : "Command");
outaddr(faddr);
vout( "(%s) to ", fl->gnd ? "on ground" : "airborne");
vout( "(%s) to ", (fl && fl->gnd) ? "on ground" : "airborne");
outaddr(taddr);
vout( "\n");

outlinkctrl(hdata[9], rep);
}

if((jsonout || netOutJsonAddr) && !routeout)
buildjsonobj(faddr,taddr,fromair,rep,fl->gnd,blk);
if((jsonout || netOutJsonAddr) && !routeout) {
buildjsonobj(faddr,taddr,fromair,rep,(fl && fl->gnd),blk);
}

dec=0;

Expand Down

0 comments on commit 62f3c39

Please sign in to comment.