nixpkgs/pkgs/by-name/mc/mcrypt/overflow_CVE-2012-4409.patch
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

25 lines
847 B
Diff

From 3efb40e17ce4f76717ae17a1ce1e1f747ddf59fd Mon Sep 17 00:00:00 2001
From: Alon Bar-Lev <alon.barlev@gmail.com>
Date: Sat, 22 Dec 2012 22:37:06 +0200
Subject: [PATCH] cleanup: buffer overflow
---
mcrypt-2.6.8/src/extra.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/mcrypt-2.6.8/src/extra.c b/mcrypt-2.6.8/src/extra.c
index 3082f82..c7a1ac0 100644
--- a/src/extra.c
+++ b/src/extra.c
@@ -241,6 +241,8 @@ int check_file_head(FILE * fstream, char *algorithm, char *mode,
if (m_getbit(6, flags) == 1) { /* if the salt bit is set */
if (m_getbit(0, sflag) != 0) { /* if the first bit is set */
*salt_size = m_setbit(0, sflag, 0);
+ if (*salt_size > sizeof(tmp_buf))
+ err_quit(_("Salt is too long\n"));
if (*salt_size > 0) {
fread(tmp_buf, 1, *salt_size,
fstream);
--
1.7.8.6