>From af1e155b81f87244580b0b66af767868991757ad Mon Sep 17 00:00:00 2001 From: Alexander Cherepanov Date: Sat, 18 May 2013 23:04:21 +0400 Subject: [PATCH 2/2] krb5: ensure that username and realm are non-empty. (Fixes SIGFPE.) --- src/KRB5_fmt_plug.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/KRB5_fmt_plug.c b/src/KRB5_fmt_plug.c index 6de6877..0f3a608 100644 --- a/src/KRB5_fmt_plug.c +++ b/src/KRB5_fmt_plug.c @@ -184,7 +184,7 @@ static void * krb5_salt(char *ciphertext) { if (!p) return NULL; n = (p - data) + 1; - if (n >= sizeof(salt.user)) + if (n <= 1 || n >= sizeof(salt.user)) return NULL; strnzcpy(salt.user, data, n); data = p + 1; @@ -194,7 +194,7 @@ static void * krb5_salt(char *ciphertext) { if (!p) return NULL; n = (p - data) + 1; - if (n >= sizeof(salt.realm)) + if (n <= 1 || n >= sizeof(salt.realm)) return NULL; strnzcpy(salt.realm, data, n); data = p + 1; -- 1.7.2.5