Skip to content

Commit 15646aa

Browse files
committed
Fix potential null pointer deference, closing issue #332
1 parent 6c42683 commit 15646aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/dialects/linux/dproc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ static int process_id(struct lsof_context *ctx, /* context */
12731273
#endif /* defined(HASEPTOPTS) */
12741274
if (rest && rest[0] == '[' && rest[1] == 'p')
12751275
fdinfo_mask |= FDINFO_PID;
1276-
else if (Lf->ntype == N_REGLR && rest && *rest && strcmp(pbuf, "pidfd") == 0) {
1276+
else if (Lf && Lf->ntype == N_REGLR && rest && *rest && strcmp(pbuf, "pidfd") == 0) {
12771277
// https://github.com/lsof-org/lsof/issues/317
12781278
fdinfo_mask |= FDINFO_PID;
12791279
}

0 commit comments

Comments
 (0)