[augeas-devel] augeas: master - * src/augeas.c: do not read past the end of the load path

David Lutterkort lutter at fedoraproject.org
Tue Sep 1 18:08:56 UTC 2009


Gitweb:        http://git.fedorahosted.org/git/augeas.git?p=augeas.git;a=commitdiff;h=eaba6ab4e34058c541ac9db949735000d73ecada
Commit:        eaba6ab4e34058c541ac9db949735000d73ecada
Parent:        c6e703f9a4bfeac2b382965f9686729727020fbb
Author:        David Lutterkort <lutter at redhat.com>
AuthorDate:    Fri Aug 28 17:30:45 2009 -0700
Committer:     David Lutterkort <lutter at redhat.com>
CommitterDate: Mon Aug 31 13:57:51 2009 -0700

* src/augeas.c: do not read past the end of the load path

---
 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;




More information about the augeas-devel mailing list