summaryrefslogtreecommitdiff
path: root/libexec/login_krb5/login_krb5.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-22 06:35:45 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2002-05-22 06:35:45 +0000
commitcf6275b2c20125ad10de0b257adff3f946265e12 (patch)
treef3c7bbaf5ca24d9e17e60388318a5de9645dc8fe /libexec/login_krb5/login_krb5.c
parent3560c67cd3c2ef49b0fdf0beb609ba65462759e7 (diff)
a bunch more strcpy -> strlcpy and sprintf -> snprintf
Diffstat (limited to 'libexec/login_krb5/login_krb5.c')
-rw-r--r--libexec/login_krb5/login_krb5.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libexec/login_krb5/login_krb5.c b/libexec/login_krb5/login_krb5.c
index 6b918288be8..91fa03261b7 100644
--- a/libexec/login_krb5/login_krb5.c
+++ b/libexec/login_krb5/login_krb5.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: login_krb5.c,v 1.14 2002/02/27 09:52:45 hin Exp $ */
+/* $OpenBSD: login_krb5.c,v 1.15 2002/05/22 06:35:44 deraadt Exp $ */
/*-
* Copyright (c) 2001, 2002 Hans Insulander <hin@openbsd.org>.
@@ -171,8 +171,10 @@ krb5_login(char *username, char *invokinguser, char *password, int login, int ti
if (strcmp(username, "root") == 0) {
char *tmp;
- tmp = malloc(strlen(invokinguser)+6);
- sprintf(tmp, "%s/root", invokinguser);
+ int len = strlen(invokinguser)+6;
+
+ tmp = malloc(len);
+ snprintf(tmp, len, "%s/root", invokinguser);
ret = krb5_parse_name(context, tmp, &princ);
free(tmp);
} else