From 1bbd5cecff0aa45bbf0cd59e680b2f6263cd1e50 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Wed, 2 Mar 2005 21:07:02 +0000 Subject: [PATCH] 2005-03-02 Alain Magloire Fix for PR 85043: NPE when calling Ar.isARHeader(null); * utils/org/eclipse/cdt/utils/elf/AR.java * utils/org/eclipse/cdt/utils/macho/AR.java * utils/org/elcipse/cdt/utils/som/AR.java * utils/org/eclipse/cdt/utils/xcoff/AR.java --- core/org.eclipse.cdt.core/ChangeLog | 7 +++++++ .../utils/org/eclipse/cdt/utils/elf/AR.java | 2 +- .../utils/org/eclipse/cdt/utils/macho/AR.java | 2 +- .../utils/org/eclipse/cdt/utils/som/AR.java | 2 +- .../utils/org/eclipse/cdt/utils/xcoff/AR.java | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/core/org.eclipse.cdt.core/ChangeLog b/core/org.eclipse.cdt.core/ChangeLog index f3837069c15..466bdf58394 100644 --- a/core/org.eclipse.cdt.core/ChangeLog +++ b/core/org.eclipse.cdt.core/ChangeLog @@ -1,3 +1,10 @@ +2005-03-02 Alain Magloire + Fix for PR 85043: NPE when calling Ar.isARHeader(null); + * utils/org/eclipse/cdt/utils/elf/AR.java + * utils/org/eclipse/cdt/utils/macho/AR.java + * utils/org/elcipse/cdt/utils/som/AR.java + * utils/org/eclipse/cdt/utils/xcoff/AR.java + 2005-02-24 Alain Magloire Part of 79596 * model/org/eclipse/cdt/internal/core/model/PathEntryManager.java diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java index fbaf34e4c89..d841422414a 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/elf/AR.java @@ -214,7 +214,7 @@ public class AR { } public static boolean isARHeader(byte[] ident) { - if (ident.length < 7 + if (ident == null || ident.length < 7 || ident[0] != '!' || ident[1] != '<' || ident[2] != 'a' diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/AR.java index 256f4ade40c..93e8f7ea6e1 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/AR.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/macho/AR.java @@ -215,7 +215,7 @@ public class AR { } public static boolean isARHeader(byte[] ident) { - if (ident.length < 7 + if (ident == null || ident.length < 7 || ident[0] != '!' || ident[1] != '<' || ident[2] != 'a' diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/AR.java index 75fa09aac3a..7a7f326b57e 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/AR.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/som/AR.java @@ -214,7 +214,7 @@ public class AR { } public static boolean isARHeader(byte[] ident) { - if (ident.length < 8 + if (ident == null || ident.length < 8 || ident[0] != '!' || ident[1] != '<' || ident[2] != 'a' diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/AR.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/AR.java index 81412837e6a..9ae33796ebc 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/AR.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/xcoff/AR.java @@ -121,7 +121,7 @@ public class AR { } public static boolean isARHeader(byte[] ident) { - if (ident.length < 8 + if (ident == null || ident.length < 8 || ident[0] != '<' || ident[1] != 'b' || ident[2] != 'i'