From 1b2802b6fbe6f1b6d8d5af08c114bdc182f11779 Mon Sep 17 00:00:00 2001 From: "Chas Williams (CONTRACTOR)" Date: Wed, 26 Mar 2014 10:25:13 -0400 Subject: [PATCH] pts: Don't assume that pr_IdToName() was successful If pr_IdToName fails for some reason, tnames won't be available. Change-Id: I5270ba0ecf3cfad9bfb909c97b27473d96ca1307 Reviewed-on: http://gerrit.openafs.org/10952 Tested-by: BuildBot Reviewed-by: Benjamin Kaduk Reviewed-by: Michael Meffie Reviewed-by: D Brashear --- src/ptserver/pts.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ptserver/pts.c b/src/ptserver/pts.c index 2fd491257..bd264e2ce 100644 --- a/src/ptserver/pts.c +++ b/src/ptserver/pts.c @@ -539,12 +539,13 @@ GetNameOrId(struct cmd_syndesc *as, struct idlist *lids, code = pr_IdToName(&ids, &tnames); if (code) afs_com_err(whoami, code, "translating ids"); - else + else { goodCount++; - if (lnames) { - for (x = 0; x < ids.idlist_len; x++) - strcpy(lnames->namelist_val[nd + x], tnames.namelist_val[x]); - lnames->namelist_len = nd + x; + if (lnames) { + for (x = 0; x < ids.idlist_len; x++) + strcpy(lnames->namelist_val[nd + x], tnames.namelist_val[x]); + lnames->namelist_len = nd + x; + } } } /* treat things as working if any of the lookups worked */ -- 2.39.5