This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Bogosity in jcf-path.c
- From: Andrew Haley <aph at redhat dot com>
- To: java at gcc dot gnu dot org
- Date: Fri, 28 Nov 2003 18:21:39 GMT
- Subject: Bogosity in jcf-path.c
I'm looking at this code:
static void
add_entry (struct entry **entp, const char *filename, int is_system)
{
int len;
struct entry *n;
n = ALLOC (sizeof (struct entry));
n->flags = is_system ? FLAG_SYSTEM : 0;
n->next = NULL;
len = strlen (filename);
if (len > 4 && (FILENAME_CMP (filename + len - 4, ".zip") == 0
|| FILENAME_CMP (filename + len - 4, ".jar") == 0))
{
n->flags |= FLAG_ZIP;
So, we compare the filename to blah.zip and conclude that it's a
zipfile. But what if blah.zip is a directory? Surely we need to open
the file and test for the magic value.
Andrew.