krb5 commit: Prevent read underrun in glob_to_regexp()
ghudson at mit.edu
ghudson at mit.edu
Wed Nov 18 20:12:09 EST 2026
https://github.com/krb5/krb5/commit/9bbee39b7275f1257c93afb372a9da00b1bca4eb
commit 9bbee39b7275f1257c93afb372a9da00b1bca4eb
Author: Aysha Afrah Ziya <aysha26 at digiscrypt.com>
Date: Mon Nov 16 00:25:42 2026 +0530
Prevent read underrun in glob_to_regexp()
In both copies of glob_to_regexp(), check that the glob is not empty
before checking if the last character is a backslash.
[ghudson at mit.edu: rewrote commit message]
ticket: 9290 (new)
tags: pullup
target_version: 1.22-next
src/kadmin/dbutil/kdb5_mkey.c | 2 +-
src/lib/kadm5/srv/svr_iters.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kadmin/dbutil/kdb5_mkey.c b/src/kadmin/dbutil/kdb5_mkey.c
index 3e213123f..8f8323eca 100644
--- a/src/kadmin/dbutil/kdb5_mkey.c
+++ b/src/kadmin/dbutil/kdb5_mkey.c
@@ -668,7 +668,7 @@ static int glob_to_regexp(char *glob, char *realm, char **regexp)
char *p;
/* validate the glob */
- if (glob[strlen(glob)-1] == '\\')
+ if (*glob != '\0' && glob[strlen(glob) - 1] == '\\')
return EINVAL;
/* A character of glob can turn into two in regexp, plus ^ and $ */
diff --git a/src/lib/kadm5/srv/svr_iters.c b/src/lib/kadm5/srv/svr_iters.c
index 4b26bc939..d81dea193 100644
--- a/src/lib/kadm5/srv/svr_iters.c
+++ b/src/lib/kadm5/srv/svr_iters.c
@@ -58,7 +58,7 @@ static kadm5_ret_t glob_to_regexp(char *glob, char *realm, char **regexp)
char *p;
/* validate the glob */
- if (glob[strlen(glob)-1] == '\\')
+ if (*glob != '\0' && glob[strlen(glob) - 1] == '\\')
return EINVAL;
/* A character of glob can turn into two in regexp, plus ^ and $ */
More information about the cvs-krb5
mailing list