You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@xerces.apache.org by Torbjörn Bäckström <to...@teleteknik.goteborg.se> on 2000/09/22 12:15:27 UTC

Minor bug in HPPlatformUtils.cpp

Hi

The file
"xml-xerces/c/src/util/Platforms/HPUX/HPPlatformUtils.cpp"
rev 1.14 (Xerces-c 1.2.0 that is) contains a minor bug.
Line 443 in function "getFullPath()" should be removed.
The code says:

line 440>    char absPath[PATH_MAX];
line 441>   //get the absolute path
line 442>    char* retPath = realpath(newSrc, &absPath[0]);
line 443>    ArrayJanitor<char> janText2(retPath);

Problem is that retPath (ie absPath) is a local variable,
so the ArrayJanitor isn't needed. The code works, though,
but is not very portable - and Purify doesn't like it :-).

I checked some (not all) of the other PlatformUtils.cpp-files,
but they don't have the problem since absPath is dynamically
allocated there.

cheers,
Tobbe
---
tobbe@cd.chalmers.se




Re: Minor bug in HPPlatformUtils.cpp

Posted by Andy Heninger <an...@jtcsv.com>.
Right you are, I just commited your patch back into cvs.
Thank you for catching this one.

Andy Heninger
IBM XML Technology Group, Cupertino, CA
heninger@us.ibm.com



----- Original Message -----
From: "Torbjörn Bäckström" <to...@teleteknik.goteborg.se>
To: <xe...@xml.apache.org>
Sent: Friday, September 22, 2000 3:15 AM
Subject: Minor bug in HPPlatformUtils.cpp


> Hi
>
> The file
> "xml-xerces/c/src/util/Platforms/HPUX/HPPlatformUtils.cpp"
> rev 1.14 (Xerces-c 1.2.0 that is) contains a minor bug.
> Line 443 in function "getFullPath()" should be removed.
> The code says:
>
> line 440>    char absPath[PATH_MAX];
> line 441>   //get the absolute path
> line 442>    char* retPath = realpath(newSrc, &absPath[0]);
> line 443>    ArrayJanitor<char> janText2(retPath);
>
> Problem is that retPath (ie absPath) is a local variable,
> so the ArrayJanitor isn't needed. The code works, though,
> but is not very portable - and Purify doesn't like it :-).
>
> I checked some (not all) of the other PlatformUtils.cpp-files,
> but they don't have the problem since absPath is dynamically
> allocated there.
>
> cheers,
> Tobbe
> ---
> tobbe@cd.chalmers.se
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-c-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-c-dev-help@xml.apache.org
>
>