[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/22245] New: Potential UB in bfd_set_error
From: |
kryukov at frtk dot ru |
Subject: |
[Bug binutils/22245] New: Potential UB in bfd_set_error |
Date: |
Tue, 03 Oct 2017 20:04:22 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=22245
Bug ID: 22245
Summary: Potential UB in bfd_set_error
Product: binutils
Version: 2.29
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: binutils
Assignee: unassigned at sourceware dot org
Reporter: kryukov at frtk dot ru
Target Milestone: ---
Hello
My student Kirill Nedostoev tried to build binutils 2.29.1 with Clang 7 and he
found a following message:
```
bfd.c:519:21: error: passing an object that undergoes default argument
promotion to 'va_start' has undefined behavior [-Werror,-Wvarargs]`
va_start (ap, error_tag);
```
The description of the actual problem is available on CERT site
https://www.securecoding.cert.org/confluence/display/cplusplus/EXP58-CPP.+Pass+an+object+of+the+correct+type+to+va_start
As a solution, we suggest to change signature of `bfd_set_error` in a following
way:
-void bfd_set_error (bfd_error_type error_tag, ...);
+void bfd_set_error (int error_tag, ...);
To get a patch, you may pull from https://github.com/pavelkryukov/binutils.git
Thanks,
Pavel Kryukov
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug binutils/22245] New: Potential UB in bfd_set_error,
kryukov at frtk dot ru <=
- [Bug binutils/22245] Potential UB in bfd_set_error, kryukov at frtk dot ru, 2017/10/03
- [Bug binutils/22245] Potential UB in bfd_set_error, amodra at gmail dot com, 2017/10/03
- [Bug binutils/22245] Potential UB in bfd_set_error, cvs-commit at gcc dot gnu.org, 2017/10/04
- [Bug binutils/22245] Potential UB in bfd_set_error, cvs-commit at gcc dot gnu.org, 2017/10/04
- [Bug binutils/22245] Potential UB in bfd_set_error, kryukov at frtk dot ru, 2017/10/04
- [Bug binutils/22245] Potential UB in bfd_set_error, cvs-commit at gcc dot gnu.org, 2017/10/04