Page MenuHomePhabricator

Format-string harden eina_strbuf_append_printf use
ClosedPublic

Authored by rvandegrift on Aug 19 2018, 2:59 PM.

Details

Summary

gcc -Werror=format-security flags this for lacking a format string. Fixes:
https://phab.enlightenment.org/T7325

Diff Detail

Repository
rEFL core/efl
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
rvandegrift created this revision.Aug 19 2018, 2:59 PM

It seems that this patch has no reviewers specified. If you are unsure who can review your patch, please check this wiki page and see if anyone can be added: https://phab.enlightenment.org/w/maintainers_reviewers/

rvandegrift requested review of this revision.Aug 19 2018, 2:59 PM
Hermet added a subscriber: Hermet.Aug 19 2018, 10:03 PM

how about eina_strbuf_append()?

zmike added a comment.Aug 20 2018, 4:01 AM

This seems related to D6863 which reverted a similar patch because it introduced regressions.

In D6867#118979, @zmike wrote:

This seems related to D6863 which reverted a similar patch because it introduced regressions.

So original, eina_strbuf_append() is correct. or both are incorrect.
Looks eina_strubf_append() is enough here.

zmike added a comment.Aug 21 2018, 7:08 AM

The original patch was to use append, which introduced regressions, the other hunk was to attempt to fix those regressions (which fixed some but not all). We should test this patch (and add unit tests related to this) to ensure that we are not adding more regressions.

In D6867#119292, @zmike wrote:

The original patch was to use append, which introduced regressions, the other hunk was to attempt to fix those regressions (which fixed some but not all). We should test this patch (and add unit tests related to this) to ensure that we are not adding more regressions.

eina_strbuf_append_printf(str, "%s", sd->template); == eina_strbuf_append(str, sd->template); logically same..
Hermet accepted this revision.Aug 26 2018, 8:10 PM
This revision is now accepted and ready to land.Aug 26 2018, 8:10 PM
This revision was automatically updated to reflect the committed changes.