Created attachment 11422 [details] check bounds befroe using The var "idx" should be checked before using in function "getstring" gas/macro.c:288. while ((in->ptr[idx] != '>' || nest) && idx < in->len) The out of bounds judgment should be in front of using.
Created attachment 11429 [details] bug file to reproduce the error the bound of char* "in->ptr" should be checked first before using!
The master branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=10c172ba93dde7cb7c46982ca217e646565bf938 commit 10c172ba93dde7cb7c46982ca217e646565bf938 Author: Wu Heng <wu.heng@zte.com.cn> Date: Fri Jan 25 13:41:47 2019 +1030 PR23940, check bounds before using PR gas/23940 * macro.c (getstring): Check array bound before accessing.
The binutils-2_32-branch branch has been updated by Alan Modra <amodra@sourceware.org>: https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=c856219bcaedba3e00f9875e01957fe64a3c3d58 commit c856219bcaedba3e00f9875e01957fe64a3c3d58 Author: Wu Heng <wu.heng@zte.com.cn> Date: Fri Jan 25 13:41:47 2019 +1030 PR23940, check bounds before using PR gas/23940 * macro.c (getstring): Check array bound before accessing. (cherry picked from commit 10c172ba93dde7cb7c46982ca217e646565bf938)
Fixed