gethostbyname() may return a pointer to static data, which is
overwritten deep inside krb_realmofhost(). Copy the host name to avoid conflicts.
This commit is contained in:
parent
3aef7b4e6c
commit
51a66525e8
1 changed files with 4 additions and 2 deletions
|
@ -1005,6 +1005,7 @@ socket_connection (host, flags)
|
||||||
CREDENTIALS cred;
|
CREDENTIALS cred;
|
||||||
Key_schedule schedule;
|
Key_schedule schedule;
|
||||||
int rem;
|
int rem;
|
||||||
|
char *realhost;
|
||||||
#endif /* KRB5 */
|
#endif /* KRB5 */
|
||||||
#endif /* KERBEROS */
|
#endif /* KERBEROS */
|
||||||
|
|
||||||
|
@ -1175,8 +1176,9 @@ socket_connection (host, flags)
|
||||||
}
|
}
|
||||||
#else /* ! KRB5 */
|
#else /* ! KRB5 */
|
||||||
ticket = (KTEXT) malloc (sizeof (KTEXT_ST));
|
ticket = (KTEXT) malloc (sizeof (KTEXT_ST));
|
||||||
rem = krb_sendauth (0L, sock, ticket, "pop", hostent->h_name,
|
realhost = strdup (hostent->h_name);
|
||||||
(char *) krb_realmofhost (hostent->h_name),
|
rem = krb_sendauth (0L, sock, ticket, "pop", realhost,
|
||||||
|
(char *) krb_realmofhost (realhost),
|
||||||
(unsigned long) 0, &msg_data, &cred, schedule,
|
(unsigned long) 0, &msg_data, &cred, schedule,
|
||||||
(struct sockaddr_in *) 0,
|
(struct sockaddr_in *) 0,
|
||||||
(struct sockaddr_in *) 0,
|
(struct sockaddr_in *) 0,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue