[augeas-devel] [PATCH 1/8] * src/augeas.c: do not read past the end of the load path
David Lutterkort
lutter at redhat.com
Mon Aug 31 21:44:27 UTC 2009
---
src/augeas.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/src/augeas.c b/src/augeas.c
index 5e3c5ec..646ec6c 100644
--- a/src/augeas.c
+++ b/src/augeas.c
@@ -260,7 +260,8 @@ struct augeas *aug_init(const char *root, const char *loadpath,
if (result->nmodpath > 0) {
argz_stringify(result->modpathz, result->nmodpath, PATH_SEP_CHAR);
char *s, *t;
- for (s = result->modpathz, t = result->modpathz; *s != '\0'; s++) {
+ const char *e = result->modpathz + strlen(result->modpathz);
+ for (s = result->modpathz, t = result->modpathz; s < e; s++) {
char *p = s;
if (*p == '/') {
while (*p == '/') p += 1;
--
1.6.2.5
More information about the augeas-devel
mailing list