diff options
-rw-r--r-- | usr/src/cmd/ptools/pfiles/pfiles.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/usr/src/cmd/ptools/pfiles/pfiles.c b/usr/src/cmd/ptools/pfiles/pfiles.c index cd5ee360d8..d752d8e95c 100644 --- a/usr/src/cmd/ptools/pfiles/pfiles.c +++ b/usr/src/cmd/ptools/pfiles/pfiles.c @@ -354,7 +354,11 @@ getflock(struct ps_prochandle *Pr, int fd, struct flock *flock_native) #ifdef _LP64 struct flock64_32 flock_target; - if (Pstatus(Pr)->pr_dmodel == PR_MODEL_ILP32) { + /* + * Pr may be NULL when pfiles is inspecting itself, but in that case + * we already know the data model of the two processes must match. + */ + if ((Pr != NULL) && (Pstatus(Pr)->pr_dmodel == PR_MODEL_ILP32)) { copyflock(flock_target, *flock_native); ret = pr_fcntl(Pr, fd, F_GETLK, &flock_target); copyflock(*flock_native, flock_target); |