After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 737633 - Fail to build because of insecure format string
Fail to build because of insecure format string
Status: RESOLVED FIXED
Product: easytag
Classification: Other
Component: general
master
Other FreeBSD
: Normal normal
: 2.2
Assigned To: EasyTAG maintainer(s)
EasyTAG maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2014-09-30 01:22 UTC by Ting-Wei Lan
Modified: 2014-09-30 07:41 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fix format string problem by using g_set_error_literal (931 bytes, patch)
2014-09-30 01:24 UTC, Ting-Wei Lan
committed Details | Review

Description Ting-Wei Lan 2014-09-30 01:22:44 UTC
I got this error when building easytag:
src/tags/id3_tag.c:229:22: error: format string is not a string literal (potentially insecure) [-Werror,-Wformat-security]

We should replace g_set_error with g_set_error_literal.
Comment 1 Ting-Wei Lan 2014-09-30 01:24:08 UTC
Created attachment 287411 [details] [review]
Fix format string problem by using g_set_error_literal
Comment 2 David King 2014-09-30 06:51:05 UTC
Review of attachment 287411 [details] [review]:

Thanks for the patch! I guess that the warning is from Clang, as gcc 4.9.1 does not emit a warning. Anyway, I modified the patch to use a format string of "%s", as that is done throughout the rest of EasyTAG, so it matches a bit better with the surrouding coding style. Pushed to master as a58b943a71fba1168393182143b70cb9de830ed2.
Comment 3 Ting-Wei Lan 2014-09-30 07:41:05 UTC
(In reply to comment #2)
> Review of attachment 287411 [details] [review]:
> 
> Thanks for the patch! I guess that the warning is from Clang, as gcc 4.9.1 does
> not emit a warning. Anyway, I modified the patch to use a format string of
> "%s", as that is done throughout the rest of EasyTAG, so it matches a bit
> better with the surrouding coding style. Pushed to master as
> a58b943a71fba1168393182143b70cb9de830ed2.

Yes, this warning is from clang 3.4.1.