Check return value from asprintf instead of string != NULL since it
undefined behavior on Linux. From Björn Sandell git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16222 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -347,14 +347,15 @@ kerberos4_is(Authenticator *ap, unsigned char *data, int cnt)
|
|||||||
Data(ap, KRB_ACCEPT, NULL, 0);
|
Data(ap, KRB_ACCEPT, NULL, 0);
|
||||||
} else {
|
} else {
|
||||||
char *msg;
|
char *msg;
|
||||||
|
int ret;
|
||||||
|
|
||||||
asprintf (&msg, "user `%s' is not authorized to "
|
ret = asprintf (&msg, "user `%s' is not authorized to "
|
||||||
"login as `%s'",
|
"login as `%s'",
|
||||||
krb_unparse_name_long(adat.pname,
|
krb_unparse_name_long(adat.pname,
|
||||||
adat.pinst,
|
adat.pinst,
|
||||||
adat.prealm),
|
adat.prealm),
|
||||||
UserNameRequested ? UserNameRequested : "<nobody>");
|
UserNameRequested ? UserNameRequested : "<nobody>");
|
||||||
if (msg == NULL)
|
if (ret == -1)
|
||||||
Data(ap, KRB_REJECT, NULL, 0);
|
Data(ap, KRB_REJECT, NULL, 0);
|
||||||
else {
|
else {
|
||||||
Data(ap, KRB_REJECT, (void *)msg, -1);
|
Data(ap, KRB_REJECT, (void *)msg, -1);
|
||||||
|
Reference in New Issue
Block a user