Skip to content

Commit

Permalink
2602 mdb ::sockparams SEGV
Browse files Browse the repository at this point in the history
Reviewed by: Gordon Ross <[email protected]>
Reviewed by: Milan Jurik <[email protected]>
Approved by: Richard Lowe <[email protected]>
  • Loading branch information
keremet authored and richlowe committed Jun 20, 2012
1 parent 91bbe3f commit 2e3183c
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions usr/src/cmd/mdb/common/modules/sockfs/sockfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ static int
sockparams_prt(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
{
struct sockparams sp;
char strdev[MAXPATHLEN];
char sockmod[MODMAXNAMELEN];

if ((flags & DCMD_ADDRSPEC) == 0) {
uint_t opt_e = 0;
Expand Down Expand Up @@ -112,12 +114,18 @@ sockparams_prt(uintptr_t addr, uint_t flags, int argc, const mdb_arg_t *argv)
return (DCMD_ERR);
}

if ((sp.sp_sdev_info.sd_devpath == NULL) ||
(mdb_readstr(strdev, sizeof (strdev),
(uintptr_t)sp.sp_sdev_info.sd_devpath) <= 0))
strcpy(strdev, "-");
if (mdb_readstr(sockmod, sizeof (sockmod),
(uintptr_t)sp.sp_smod_name) <= 0)
strcpy(sockmod, "");

mdb_printf("%0?p %3u %3u %3u %15s %15s %6u %#6x\n",
addr,
sp.sp_family, sp.sp_type, sp.sp_protocol,
(sp.sp_sdev_info.sd_devpath != 0) ?
sp.sp_sdev_info.sd_devpath : "-",
sp.sp_smod_name, sp.sp_refcnt,
strdev, sockmod, sp.sp_refcnt,
sp.sp_flags);


Expand Down

0 comments on commit 2e3183c

Please sign in to comment.