summaryrefslogtreecommitdiff
path: root/client/gtk.c
diff options
context:
space:
mode:
authorLinus Walleij <linus@foobar.localdomain>2010-02-20 22:58:49 +0100
committerSamuel Lidén Borell <samuel@slbdata.se>2010-02-20 23:08:06 +0100
commit9ac14e115a8cf5cc0771de30879efb74a4028d40 (patch)
tree1521d8fd6e08a23ccfbf5b978baa5bba33a12b1b /client/gtk.c
parent2605e8dd6ffd0b8cc710a3f91d58192cd510473a (diff)
downloadfribid-9ac14e115a8cf5cc0771de30879efb74a4028d40.tar.gz
fribid-9ac14e115a8cf5cc0771de30879efb74a4028d40.tar.bz2
fribid-9ac14e115a8cf5cc0771de30879efb74a4028d40.zip
Introduce guaranteed_memset()
This patch tries to counter the issues presented by some compilers that agressively optimize inlined memset() code. Solution proposed by Michael Howard as documented in David Wheelers secure programming book. Signed-off-by: Linus Walleij <linus.ml.walleij@gmail.com>
Diffstat (limited to 'client/gtk.c')
-rw-r--r--client/gtk.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/client/gtk.c b/client/gtk.c
index b3df837..786d2c5 100644
--- a/client/gtk.c
+++ b/client/gtk.c
@@ -39,6 +39,7 @@
#include "bankid.h"
#include "keyfile.h"
#include "platform.h"
+#include "misc.h"
#define _(string) gettext(string)
@@ -130,7 +131,7 @@ static bool addSignatureFile(GtkListStore *signatures, const char *filename,
}
}
free(people);
- memset(fileData, 0, fileLen);
+ guaranteed_memset(fileData, 0, fileLen);
free(fileData);
return (personCount != 0);