[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/11733] New: Out of bounds array access prevents build.
From: |
forest dot belton at gmail dot com |
Subject: |
[Bug gas/11733] New: Out of bounds array access prevents build. |
Date: |
21 Jun 2010 05:00:13 -0000 |
When compiling binutils for the sh4-elf target, the following error occurs:
../../src/binutils-2.20.1/gas/config/tc-sh.c: In function 'find_cooked_opcode':
../../src/binutils-2.20.1/gas/config/tc-sh.c:2540:7: error: array subscript is
above array bounds
Upon closer inspection, it seems to be due to the line: name[nlen] = 0;
name is declared as a char[20], and the previous for loop describes name < 20
as
one of the predicates.
A fix for this would involve either changing name to be a char[21] instead, or
perhaps changing the predicate in the loop to be name < (sizeof (name) - 1).
I'm
not familiar enough with the binutils source to comment on which would be the
more suitable option.
--
Summary: Out of bounds array access prevents build.
Product: binutils
Version: 2.20
Status: NEW
Severity: minor
Priority: P2
Component: gas
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: forest dot belton at gmail dot com
CC: bug-binutils at gnu dot org
GCC build triplet: sh4-unknown-elf
GCC host triplet: i686-pc-mingw32
GCC target triplet: sh4-unknown-elf
http://sourceware.org/bugzilla/show_bug.cgi?id=11733
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug gas/11733] New: Out of bounds array access prevents build.,
forest dot belton at gmail dot com <=