From 75b06489dcd8243b3bdb4b113d22761623b02419 Mon Sep 17 00:00:00 2001 From: Richard Basch Date: Sun, 21 Nov 1993 10:04:57 +0000 Subject: GetKerberosData was trying to pass a struct instead of a ulong, as was expected by krb_rd_req() [metcalf@lcs] --- server/kstuff.c | 87 +++++++++++++++++++++++++++++---------------------------- 1 file changed, 44 insertions(+), 43 deletions(-) (limited to 'server/kstuff.c') diff --git a/server/kstuff.c b/server/kstuff.c index 20c5a55..49089de 100644 --- a/server/kstuff.c +++ b/server/kstuff.c @@ -63,44 +63,45 @@ GetKerberosData(fd, haddr, kdata, service, srvtab) char *service; /* service principal desired */ char *srvtab; /* file to get keys from */ { - char p[20]; - KTEXT_ST ticket; /* will get Kerberos ticket from client */ - int i; - char instance[INST_SZ]; - - /* - * Get the Kerberos ticket. The first few characters, terminated - * by a blank, should give us a length; then get than many chars - * which will be the ticket proper. - */ - for (i=0; i<20; i++) { - if (read(fd, &p[i], 1) != 1) { - syslog(LOG_WARNING,"bad read tkt len"); - return(KFAILURE); - } - if (p[i] == ' ') { - p[i] = '\0'; - break; - } - } - ticket.length = atoi(p); - if ((i==20) || (ticket.length<=0) || (ticket.length>MAX_KTXT_LEN)) { - syslog(LOG_WARNING,"bad tkt len %d",ticket.length); + char p[20]; + KTEXT_ST ticket; /* will get Kerberos ticket from client */ + int i; + char instance[INST_SZ]; + + /* + * Get the Kerberos ticket. The first few characters, terminated + * by a blank, should give us a length; then get than many chars + * which will be the ticket proper. + */ + for (i=0; i<20; i++) { + if (read(fd, &p[i], 1) != 1) { + syslog(LOG_WARNING,"bad read tkt len"); return(KFAILURE); } - for (i=0; iMAX_KTXT_LEN)) { + syslog(LOG_WARNING,"bad tkt len %d",ticket.length); + return(KFAILURE); + } + for (i=0; idata) { - xfree((void *) ae->data); - ae->data = 0; - } - ae->len = 0; - ae->expire_time = 0; - free_zstring(ae->principal); - ae->principal= 0; + if (ae->data) { + xfree((void *) ae->data); + ae->data = 0; + } + ae->len = 0; + ae->expire_time = 0; + free_zstring(ae->principal); + ae->principal= 0; } static int -- cgit v1.2.3