dmraid: add patch to build with format hardening

This commit is contained in:
Robin Gloster 2016-01-29 05:25:51 +00:00
parent e721382448
commit cce1bad2e1
2 changed files with 20 additions and 0 deletions

View File

@ -8,6 +8,8 @@ stdenv.mkDerivation rec {
sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq"; sha256 = "0m92971gyqp61darxbiri6a48jz3wq3gkp8r2k39320z0i6w8jgq";
}; };
patches = [ ./hardening-format.patch ];
postPatch = '' postPatch = ''
sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in sed -i 's/\[\[[^]]*\]\]/[ "''$''${n##*.}" = "so" ]/' */lib/Makefile.in
''; '';

View File

@ -0,0 +1,18 @@
--- a/1.0.0.rc16/lib/events/libdmraid-events-isw.c 2016-01-29 05:16:57.455425454 +0000
+++ b/1.0.0.rc16/lib/events/libdmraid-events-isw.c 2016-01-29 05:17:55.520564013 +0000
@@ -838,13 +838,13 @@
sz = _log_all_devs(log_type, rs, NULL, 0);
if (!sz) {
- syslog(LOG_ERR, msg[0]);
+ syslog(LOG_ERR, "%s", msg[0]);
return;
}
str = dm_malloc(++sz);
if (!str) {
- syslog(LOG_ERR, msg[1]);
+ syslog(LOG_ERR, "%s", msg[1]);
return;
}