summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2008-01-13 21:33:00 +0000
committerKarl Berry <karl@freefriends.org>2008-01-13 21:33:00 +0000
commitda3e320d2f5628449299c09fe1b413f5852cd6d1 (patch)
treef4406abcf21e31bbc2688633311dbbbed50680a1 /Build
parent08ffcc25acc42d01f5d3aecece204520a2076ffe (diff)
protect against loc<=0, from dak
git-svn-id: svn://tug.org/texlive/trunk@6217 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/kpathsea/ChangeLog5
-rw-r--r--Build/source/texk/kpathsea/kpsewhich.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog
index a0faf354f8d..989071edbd8 100644
--- a/Build/source/texk/kpathsea/ChangeLog
+++ b/Build/source/texk/kpathsea/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-13 Karl Berry <karl@tug.org>
+
+ * kpsewhich.c (subdir_match): protect again loc going infinitely
+ negative. Found by dak, 8 Jan 2008 14:51:08.
+
2008-01-05 Karl Berry <karl@tug.org>
* texmf.in (progname, engine): distinguish the unset values.
diff --git a/Build/source/texk/kpathsea/kpsewhich.c b/Build/source/texk/kpathsea/kpsewhich.c
index 2ef873c3e6a..98f5c51b002 100644
--- a/Build/source/texk/kpathsea/kpsewhich.c
+++ b/Build/source/texk/kpathsea/kpsewhich.c
@@ -1,7 +1,7 @@
/* kpsewhich -- standalone path lookup and variable expansion for Kpathsea.
Ideas from Thomas Esser, Pierre MacKay, and many others.
- Copyright (C) 1995-2007 Karl Berry & Olaf Weber.
+ Copyright (C) 1995-2008 Karl Berry & Olaf Weber.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
@@ -188,7 +188,7 @@ subdir_match P2C(str_list_type, subdirs, string *, matches)
string s = xstrdup (matches[m]);
for (loc = strlen (s); loc > 0 && !IS_DIR_SEP (s[loc-1]); loc--)
;
- while (IS_DIR_SEP (s[loc-1])) {
+ while (loc > 0 && IS_DIR_SEP (s[loc-1])) {
loc--;
}
s[loc] = 0; /* wipe out basename */