From 0e7b44f7f89291d8ae75e4f099d8aa2bcca1cfc5 Mon Sep 17 00:00:00 2001 From: Ludwig Nussel Date: Tue, 9 Oct 2007 14:34:15 +0200 Subject: [PATCH] fix buffer overflow Signed-off-by: Ludwig Nussel --- mount/lomount.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) Index: util-linux-ng-2.13rc2+git20070725/mount/lomount.c =================================================================== --- util-linux-ng-2.13rc2+git20070725.orig/mount/lomount.c +++ util-linux-ng-2.13rc2+git20070725/mount/lomount.c @@ -25,8 +25,8 @@ #include "xstrncpy.h" #include "nls.h" -#ifndef MAX -#define MAX(a,b) ((a>b)?(a):(b)) +#ifndef MIN +#define MIN(a,b) ((a>3; } + if((unsigned)loopinfo64.lo_encrypt_key_size > sizeof(loopinfo64.lo_encrypt_key)) { + fprintf(stderr, _("invalid key length\n")); + return 1; + } + if (phash) { if(!strcasecmp(phash, "sha512")) { hfunc = sha512_hash_buffer;