summaryrefslogtreecommitdiff
path: root/xhost.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-23 08:50:29 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2013-02-23 08:50:29 -0800
commit59da6b7438ab624593fe4ce52a402755cce25b12 (patch)
tree9bd46f5981c7925706358580783dddbd45dac805 /xhost.c
parenta9218c958e992adb727ea5fe45cb04f9ba611de1 (diff)
Convert sprintf to snprintf in SECURE_RPC code
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Diffstat (limited to 'xhost.c')
-rw-r--r--xhost.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xhost.c b/xhost.c
index abbfcc1..6545fb7 100644
--- a/xhost.c
+++ b/xhost.c
@@ -765,8 +765,8 @@ get_hostname(XHostAddress *ha)
pwd = getpwuid(uid);
if (pwd)
- sprintf(netname, "%s@ (%*.*s)", pwd->pw_name,
- ha->length, ha->length, ha->address);
+ snprintf(netname, sizeof(netname), "%s@ (%*.*s)",
+ pwd->pw_name, ha->length, ha->length, ha->address);
}
#endif
return (netname);