Mercurial > hg > xemacs-beta
changeset 5835:e24390bd4235
Fix off-by-one error in Ffile_truename.
See <CAHCOHQnOwYH5kF0mq6184Fetuus-KOeKNUpTHYXhq56AvcuE9A@mail.gmail.com>
in xemacs-patches.
author | Jerry James <james@xemacs.org> |
---|---|
date | Fri, 05 Dec 2014 16:56:13 -0700 |
parents | 7984e732829e |
children | c03dd89e0055 |
files | src/ChangeLog src/fileio.c |
diffstat | 2 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/src/ChangeLog Fri Dec 05 16:22:57 2014 -0700 +++ b/src/ChangeLog Fri Dec 05 16:56:13 2014 -0700 @@ -1,3 +1,7 @@ +2014-12-05 Jerry James <james@xemacs.org> + + * src/fileio.c (Ffile_truename): Fix off-by-one error. + 2014-11-23 Michael Sperber <mike@xemacs.org> * font-mgr.c (Ffc_name_unparse): Do the previous change to this
--- a/src/fileio.c Fri Dec 05 16:22:57 2014 -0700 +++ b/src/fileio.c Fri Dec 05 16:56:13 2014 -0700 @@ -1466,7 +1466,7 @@ if (elen > 0 && IS_DIRECTORY_SEP (string_byte (expanded_name, elen - 1)) && !(rlen > 0 && IS_DIRECTORY_SEP (resolved_path[rlen - 1]))) { - if (rlen + 1 > countof (resolved_path)) + if (rlen + 1 >= countof (resolved_path)) goto toolong; resolved_path[rlen++] = DIRECTORY_SEP; resolved_path[rlen] = '\0';