Bug 23939 - Check frch_cfi_data before use
Summary: Check frch_cfi_data before use
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.32
: P2 normal
Target Milestone: 2.32
Assignee: Alan Modra
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-30 08:45 UTC by wuheng
Modified: 2018-12-04 09:28 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed: 2018-12-03 00:00:00


Attachments
check var frch_cfi_data before using it (319 bytes, patch)
2018-11-30 08:45 UTC, wuheng
Details | Diff
check var frch_cfi_data before using it (620 bytes, patch)
2018-12-01 07:44 UTC, wuheng
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description wuheng 2018-11-30 08:45:30 UTC
Created attachment 11421 [details]
check var frch_cfi_data before using it

the var "frchain_now->frch_cfi_data" in "dot_cfi_label" function at dw2gencfi.c:1207 should be checked before use! Program may throw SIGSEGV if not.
Comment 1 wuheng 2018-12-01 07:44:04 UTC
Created attachment 11427 [details]
check var frch_cfi_data before using it

I add a test in testsuits, please recheck, thanks very much.
Comment 2 Alan Modra 2018-12-03 02:06:41 UTC
How would you like your name to appear on a ChangeLog entry?
Comment 3 wuheng 2018-12-04 00:51:43 UTC
(In reply to Alan Modra from comment #2)
> How would you like your name to appear on a ChangeLog entry?

Author: wu.heng <wu.heng@zte.com.cn>
Thanks very much!
Comment 4 cvs-commit@gcc.gnu.org 2018-12-04 06:07:55 UTC
The master branch has been updated by Alan Modra <amodra@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=314a80c41d52737c9cfdc80dc2f6f56e0d5cfd96

commit 314a80c41d52737c9cfdc80dc2f6f56e0d5cfd96
Author: wu.heng <wu.heng@zte.com.cn>
Date:   Mon Dec 3 12:32:13 2018 +1030

    PR23939, Check frch_cfi_data before use
    
    	PR 23939
    	* dw2gencfi.c (dot_cfi_label): Check frch_cfi_data is non-NULL
    	before use.
Comment 5 Alan Modra 2018-12-04 09:28:16 UTC
Fixed for 2.32.  I didn't commit the testcase because it is very unlikely for gas to regress.