From 4a5e1d6fe199a896d5816614e70cdcd4c1efd575 Mon Sep 17 00:00:00 2001 From: Salvatore Culcasi Date: Mon, 14 May 2012 00:47:54 -0400 Subject: Bug 322475 - Internal error (NegativeArraySizeException) in Dwarf --- .../utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java index 1914774515b..032f14b8d6d 100644 --- a/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java +++ b/core/org.eclipse.cdt.core/utils/org/eclipse/cdt/utils/debug/dwarf/Dwarf.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2009 QNX Software Systems and others. + * Copyright (c) 2000, 2012 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -7,6 +7,7 @@ * * Contributors: * QNX Software Systems - Initial API and implementation + * Salvatore Culcasi - Bug 322475 *******************************************************************************/ package org.eclipse.cdt.utils.debug.dwarf; @@ -476,7 +477,7 @@ public class Dwarf { case DwarfConstants.DW_FORM_block1 : { int size = in.get(); - byte[] bytes = new byte[size]; + byte[] bytes = new byte[size & 0xff]; in.get(bytes); obj = bytes; } @@ -485,7 +486,7 @@ public class Dwarf { case DwarfConstants.DW_FORM_block2 : { int size = read_2_bytes(in); - byte[] bytes = new byte[size]; + byte[] bytes = new byte[size & 0xffff]; in.get(bytes); obj = bytes; } -- cgit v1.2.3