Skip Menu |
 

Download (untitled) / with headers
text/plain 2.3KiB
From dsr@mail.lns.cornell.edu Sat Sep 14 15:36:55 2002
Received: from fort-point-station.mit.edu (FORT-POINT-STATION.MIT.EDU [18.7.7.76]) by krbdev.mit.edu (8.9.3) with ESMTP
id PAA08459; Sat, 14 Sep 2002 15:36:55 -0400 (EDT)
Received: from lnscu5.lns.cornell.edu (lnscu5.lns.cornell.edu [128.84.44.111])
by fort-point-station.mit.edu (8.9.2/8.9.2) with ESMTP id PAA19076
for <krb5-bugs@mit.edu>; Sat, 14 Sep 2002 15:36:55 -0400 (EDT)
Received: from nile02.lns.cornell.edu (nile02.lns.cornell.edu [128.84.46.186])
by lnscu5.lns.cornell.edu (8.12.2/8.12.2) with ESMTP id g8EJascp023372
for <krb5-bugs@mit.edu>; Sat, 14 Sep 2002 15:36:54 -0400 (EDT)
From: Dan Riley <dsr@mail.lns.cornell.edu>
Received: by nile02.lns.cornell.edu (8.8.8/1.1.10.5/23Nov96-0144PM)
id PAA0000029434; Sat, 14 Sep 2002 15:36:53 -0400 (EDT)
Date: Sat, 14 Sep 2002 15:36:53 -0400 (EDT)
Message-Id: <200209141936.PAA0000029434@nile02.lns.cornell.edu>
To: krb5-bugs@mit.edu
Subject: krb524/sendmsg.c does not compile on Tru64 with 'cc -std1'
Reply-To: dsr@mail.lns.cornell.edu
X-send-pr-version: 3.99


Show quoted text
>Submitter-Id: net
>Originator: Dan Riley
>Organization: LEPP, Cornell University
>Confidential: no
>Synopsis: krb524/sendmsg.c may be rejected by picky compilers
>Severity: non-critical
>Priority: medium
>Category: krb5-build
>Class: sw-bug
>Release: krb5-1.2.6
>Environment:
System: OSF1 nile02.lns.cornell.edu V4.0 1229 alpha
Machine: alpha
Show quoted text
>Description:
Tru64 'cc -std1' rejects krb524/sendmsg.c due to a minor but in the
source
Show quoted text
>How-To-Repeat:
Compile krb5 1.2.6 on Tru64 with 'cc -std1'; it will refuse to
compile this line in sendmsg.c:

if ((local_addr != NULL) && (addrlen != NULL) && (addrlen > 0)) {

with the (correct) complaint that the result of comparing a pointer
(addrlen) to be greater than 0 is undefined.
Show quoted text
>Fix:
I'd guess that the intent was to check that the value pointed to by
addrlen is > 0:

--- krb5-1.2.6/src/krb524/sendmsg.c Tue May 28 11:18:52 2002
+++ krb5/src/krb524/sendmsg.c Sat Sep 14 14:32:33 2002
@@ -227,7 +227,7 @@

/* If the caller wants the local address of this socket
store it here */
- if ((local_addr != NULL) && (addrlen != NULL) && (addrlen > 0)) {
+ if ((local_addr != NULL) && (addrlen != NULL) && (*addrlen > 0)) {
if (getsockname (socklist[host], local_addr, addrlen) == SOCKET_ERROR) {
/* no address to get... tell the caller we got nothing */
*addrlen = 0;
From Nikola.Milutinovic@ev.co.yu Thu Nov 7 02:39:42 2002
Received: from fort-point-station.mit.edu (FORT-POINT-STATION.MIT.EDU [18.7.7.76]) by krbdev.mit.edu (8.9.3) with ESMTP
id CAA14973; Thu, 7 Nov 2002 02:39:42 -0500 (EST)
From: Nikola.Milutinovic@ev.co.yu
Received: from Firewall.ev.co.yu (gateway.ev.co.yu [194.247.214.130])
by fort-point-station.mit.edu (8.9.2/8.9.2) with SMTP id CAA05868
for <krb5-bugs@mit.edu>; Thu, 7 Nov 2002 02:39:38 -0500 (EST)
Received: by Firewall.ev.co.yu; (5.65v4.0/1.3/10May95) id AA22101; Sat, 7 Nov 1998 08:45:08 +0100
Received: from Legba.ev.co.yu (smmsp@localhost [127.0.0.1])
by Legba.ev.co.yu (8.12.5/8.12.5) with ESMTP id gA77hBbC000796
(version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=FAIL)
for <krb5-bugs@mit.edu>; Thu, 7 Nov 2002 08:43:12 +0100 (MET)
Received: (from root@localhost)
by Legba.ev.co.yu (8.12.5/8.12.5/Submit) id gA77hBBb001143;
Thu, 7 Nov 2002 08:43:11 +0100 (MET)
Date: Thu, 7 Nov 2002 08:43:11 +0100 (MET)
Message-Id: <200211070743.gA77hBBb001143@Legba.ev.co.yu>
To: krb5-bugs@mit.edu
Reply-To: Nikola.Milutinovic@ev.co.yu
X-Send-Pr-Version: 3.99


Show quoted text
>Submitter-Id: net
>Originator: Nikola Milutinovic
>Organization: EPS Elektrovojvodina

Show quoted text
>Confidential: no
>Synopsis: An error in source stops compiling (or Heaven help us if it doesn't)
>Severity: serious
>Priority: low
>Category: krb5-build
>Class: sw-bug
>Release: krb5-1.2.6
>Environment:

System: OSF1 Legba.ev.co.yu V4.0 1229 alpha (Tru64 UNIX 4.0F)
Machine: DEC AlphaStation 200 4/233
Show quoted text
>Description:
Build fails in file "./src/krb524/sendmsg.c", at line 230, complaining that
"addrlen" cannot be compared to "0". The offending line is:

if ((local_addr != NULL) && (addrlen != NULL) && (addrlen > 0)) {

Indeed, "addrlen" is "int *", which cannot be compared to integers.
I gues the idea was to compare what addrlen points to and 0.

Show quoted text
>How-To-Repeat:
Just compile it with any ANSI C compiler, it should belch on that line.

Show quoted text
>Fix:
I have added "*" in front if "addrlen", so the line mow reads:

if ((local_addr != NULL) && (addrlen != NULL) && (*addrlen > 0)) {

To: rt-comment@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #1243] An error in source stops compiling (or Heaven help us if it doesn't)
From: Sam Hartman <hartmans@mit.edu>
Date: Thu, 07 Nov 2002 14:09:13 -0500
RT-Send-Cc:
Hmm, I think we may actually want to fix this one for 1.2.7. This was
introduced in KFM changes which I apparently failed to audit correctly.
From: tlyu@mit.edu
Subject: CVS Commit
Yeah, oops, we forgot to deal with this earlier.

* sendmsg.c (krb524_sendto_kdc): Check for *addrlen > 0 (not
addrlen, which is a pointer). Patch from Dan Riley.


To generate a diff of this commit:



cvs diff -r1.63.2.1.2.11 -r1.63.2.1.2.12 krb5/src/krb524/ChangeLog
cvs diff -r1.10.4.3 -r1.10.4.4 krb5/src/krb524/sendmsg.c
From: tlyu@mit.edu
Subject: CVS Commit
Yeah, oops, we forgot to deal with this earlier.

* sendmsg.c (krb524_sendto_kdc): Check for *addrlen > 0 (not
addrlen, which is a pointer). Patch from Dan Riley.


To generate a diff of this commit:



cvs diff -r1.63.2.1.2.11 -r1.63.2.1.2.12 krb5/src/krb524/ChangeLog
cvs diff -r1.10.4.3 -r1.10.4.4 krb5/src/krb524/sendmsg.c
Date: Fri, 08 Nov 2002 07:09:18 +0100
From: Nikola Milutinovic <Nikola.Milutinovic@ev.co.yu>
To: rt-comment@krbdev.mit.edu
Subject: Re: [krbdev.mit.edu #1243] CVS Commit
RT-Send-Cc:
Tom Yu via RT wrote:
Show quoted text
> Yeah, oops, we forgot to deal with this earlier.
>
> * sendmsg.c (krb524_sendto_kdc): Check for *addrlen > 0 (not
> addrlen, which is a pointer). Patch from Dan Riley.
>
>
> To generate a diff of this commit:
>
>
>
> cvs diff -r1.63.2.1.2.11 -r1.63.2.1.2.12 krb5/src/krb524/ChangeLog
> cvs diff -r1.10.4.3 -r1.10.4.4 krb5/src/krb524/sendmsg.c

:-)

Since I patched it manually, I guess I don't need to fire up CVS.

Nix.