Skip Menu |
 

Download (untitled) / with headers
text/plain 2.5KiB
From epeisach@engrailed.mit.edu Thu Sep 2 10:12:12 1999
Received: from MIT.EDU (SOUTH-STATION-ANNEX.MIT.EDU [18.72.1.2]) by rt-11.MIT.EDU (8.7.5/8.7.3) with SMTP id KAA09316 for <bugs@RT-11.MIT.EDU>; Thu, 2 Sep 1999 10:12:12 -0400
Received: from ENGRAILED.MIT.EDU by MIT.EDU with SMTP
id AA26837; Thu, 2 Sep 99 10:12:01 EDT
Received: (from epeisach@localhost) by engrailed.mit.edu (980427.SGI.8.8.8/970903.SGI.AUTOCF) id KAA60158; Thu, 2 Sep 1999 10:01:18 -0400 (EDT)
Message-Id: <199909021401.KAA60158@engrailed.mit.edu>
Date: Thu, 2 Sep 1999 10:01:18 -0400 (EDT)
From: epeisach@engrailed.mit.edu (Ezra Peisach)
Reply-To: epeisach@engrailed.mit.edu
To: krb5-bugs@MIT.EDU
Subject: ksu/main.c disregards const char * return from krb5_cc_default_name
X-Send-Pr-Version: 3.99

Show quoted text
>Number: 745
>Category: krb5-clients
>Synopsis: Compiler warning when compiling ksu in main.c
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: krb5-unassigned
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Thu Sep 02 10:13:01 EDT 1999
>Last-Modified:
>Originator: Ezra Peisach
>Organization:
MIT
Show quoted text
>Release: krb5-1.1-beta1
>Environment:

System: IRIX64 engrailed 6.5 05190004 IP30


Show quoted text
>Description:
"../../../src/clients/ksu/main.c", line 378: warning(1515): a value of type
"const char *" cannot be assigned to an entity of type "char *"
cc_source_tag = krb5_cc_default_name(ksu_context);

krb5_cc_default_name() returns a const char *.

While the code path does not appear to muck with the contents of
krb5_cc_default_name() (hence the low severity of the bug), I feel it
only proper to fix.

Show quoted text
>How-To-Repeat:
Compile

Show quoted text
>Fix:
A proper fix is to fix all char * to const char * as needed, but
one gets into trouble with cc_target_tag being used as an
argument to sprintf. I have resorted to the memory leaking
simple fix of:

*** main.c 1999/09/02 13:35:26 1.1
--- main.c 1999/09/02 13:56:02
***************
*** 375,381 ****
/***********************************/

if (cc_source_tag == NULL){
! cc_source_tag = krb5_cc_default_name(ksu_context);
cc_source_tag_tmp = strchr(cc_source_tag, ':') + 1;
if (cc_source_tag_tmp == (char *) 1)
cc_source_tag_tmp = cc_source_tag;
--- 375,381 ----
/***********************************/

if (cc_source_tag == NULL){
! cc_source_tag = strdup(krb5_cc_default_name(ksu_context));
cc_source_tag_tmp = strchr(cc_source_tag, ':') + 1;
if (cc_source_tag_tmp == (char *) 1)
cc_source_tag_tmp = cc_source_tag;

Show quoted text
>Audit-Trail:
>Unformatted: