]> git.ipfire.org Git - thirdparty/systemd.git/commit
string-util: rework memory_erase() to not use GCC optimize attribute (#3812)
authorMichael Biebl <mbiebl@gmail.com>
Wed, 27 Jul 2016 03:32:37 +0000 (05:32 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 27 Jul 2016 03:32:37 +0000 (23:32 -0400)
commitb6b609dbc202e5645fc58e87b8a7d46426ee4bb7
tree6bb47c6c386bffcb1de3b12a24aaa335c0e4d3ca
parent5a8ff0e61dd8094b2b5d0b35df2ca13b489e0dfa
string-util: rework memory_erase() to not use GCC optimize attribute (#3812)

"#pragma GCC optimize" is merely a convenience to decorate multiple
functions with attribute optimize. And the manual has this to say about
this attribute:

  This attribute should be used for debugging purposes only. It
  is not suitable in production code.

Some versions of GCC also seem to have a problem with this pragma in
combination with LTO, resulting in ICEs.

So use a different approach (indirect the memset call via a volatile
function pointer) as implemented in openssl's crypto/mem_clr.c.

Closes: #3811
src/basic/string-util.c