summaryrefslogtreecommitdiff
path: root/libps/spec.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2010-12-25 22:50:05 +0100
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2010-12-25 22:50:05 +0100
commit6448d964c8c845219238800ec2171f96b938abc4 (patch)
treecad5aec26ad88410367fa3ddb457c3fe4bc3b344 /libps/spec.c
parentb8215e9e6754b5bc468552c91cecdd74563fa331 (diff)
Fix NULL dereference
* libps/spec.c (ps_emit_user_name): Do not dereference pw when it is NULL, dereference u instead.
Diffstat (limited to 'libps/spec.c')
-rw-r--r--libps/spec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libps/spec.c b/libps/spec.c
index 5499bc15..b34a2343 100644
--- a/libps/spec.c
+++ b/libps/spec.c
@@ -579,7 +579,7 @@ ps_emit_user_name (struct proc_stat *ps, struct ps_fmt_field *field,
if (pw == NULL)
{
char buf[20];
- sprintf (buf, "(UID %d)", pw->pw_uid);
+ sprintf (buf, "(UID %d)", u->uid);
return ps_stream_write_field (stream, buf, width);
}
else