Bug 21822 - fastjar/jartool.c's usage of MAXPATHLEN
Summary: fastjar/jartool.c's usage of MAXPATHLEN
Alias: None
Product: gcc
Classification: Unclassified
Component: fastjar (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
Keywords: build
Depends on:
Blocks: 21824
  Show dependency treegraph
Reported: 2005-05-30 15:03 UTC by Alfred M. Szmidt
Modified: 2007-02-12 23:38 UTC (History)
2 users (show)

See Also:
Host: i686-pc-gnu0.3
Target: i686-pc-gnu0.3
Build: i686-pc-gnu0.3
Known to work:
Known to fail:
Last reconfirmed: 2005-06-19 14:01:11

Remoev arbitrary limit. (893 bytes, patch)
2005-10-01 16:42 UTC, Alfred M. Szmidt
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alfred M. Szmidt 2005-05-30 15:03:25 UTC
The way MAXPATHLEN is used in jartool.c is wrong, instead of defining a bogus
value on platforms that do not have MAXPATHLEN defined (i.e. GNU) one should try
and use getcwd as follows:

  char *dir = getcwd (NULL, 0);

instead of passing a buffer and a size.

This will only work on systems that use the GNU C Library.
Comment 1 Andrew Pinski 2005-05-30 15:10:38 UTC
You should report this to the up stream as GCC just merges with fastjar see the README in fastjar 
Comment 2 joseph@codesourcery.com 2005-05-30 17:03:00 UTC
Subject: Re:  fastjar/jartool.c's usage of MAXPATHLEN

On Mon, 30 May 2005, pinskia at gcc dot gnu dot org wrote:

> You should report this to the up stream as GCC just merges with fastjar see the README in fastjar 
> directory.

As a practical matter fastjar and libffi do not get maintained outside of 
GCC (whereas zlib does).

Comment 3 Andrew Pinski 2005-06-19 14:01:11 UTC
Comment 4 Alfred M. Szmidt 2005-10-01 16:42:05 UTC
Created attachment 9858 [details]
Remoev arbitrary limit.

Fixes fastjar.

2005-09-16  Alfred M. Szmidt  <ams@gnu.org>

	* jartool.c (MAXPATHLEN) [!MAXPATHLEN]: Removed macro.
	(get_next_arg): Allocate memory dynamiclly for S.
	(add_to_jar_with_dir): Allocate memory dynamiclly for OLD_DIR
Comment 5 Andrew Pinski 2006-04-22 20:57:16 UTC
FastJar has since been removed from GCC's sources 
Comment 6 Dalibor Topic 2007-02-12 23:38:33 UTC
thanks for the patch, I've checked it in at fastjar project on savannah.