From f9ff4a203b8c155d51a208cadadb62f224fba715 Mon Sep 17 00:00:00 2001 From: Oliver Giles Date: Mon, 1 Feb 2021 10:18:17 +1300 Subject: [PATCH] Ensure the size of the version field is 4 bytes A corrupted version field size can cause TNEFVersion to access outside of allocated memory. Check the version is the expected size and raise an error if not. Resolves: #86 Reported-by: jasperla --- lib/ytnef.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ytnef.c b/lib/ytnef.c index b148719..ffede44 100644 --- a/lib/ytnef.c +++ b/lib/ytnef.c @@ -335,6 +335,10 @@ int TNEFRendData STD_ARGLIST { int TNEFVersion STD_ARGLIST { WORD major; WORD minor; + if (size != 2 * sizeof(WORD)) { + printf("Incorrect size of version field, suspected corruption\n"); + return -1; + } minor = SwapWord((BYTE*)data, size); major = SwapWord((BYTE*)data + 2, size - 2); tr>Wojtek's customized Guix
aboutsummaryrefslogtreecommitdiff
path: root/tests/guix-repl.sh
AgeCommit message (Expand)Author
2020-09-16repl: Look for script files in (getcwd)....Fixes <https://bugs.gnu.org/43331>. * guix/scripts/repl.scm (guix-repl): Replace "." by (getcwd) * tests/guix-repl.sh: Add test. Co-authored-by: Ludovic Courtès <ludo@gnu.org> Konrad Hinsen
2020-06-14guix repl: Add script execution....* guix/scripts/repl.scm: Add filename options for script execution. * doc/guix.texi (Invoking guix repl): Document it. * tests/guix-repl.sh: Test it. * Makefile.am: (SH_TESTS): Add it. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Konrad Hinsen