emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master d79fe1f: Fix an off-by-one error in assertion


From: Eli Zaretskii
Subject: [Emacs-diffs] master d79fe1f: Fix an off-by-one error in assertion
Date: Sat, 22 Jun 2019 05:00:04 -0400 (EDT)

branch: master
commit d79fe1f7772a3ea6f998aeab10fe845f14493084
Author: Eli Zaretskii <address@hidden>
Commit: Eli Zaretskii <address@hidden>

    Fix an off-by-one error in assertion
    
    * src/fileio.c (Fexpand_file_name): Fix off-by-one error in an
    assertion.  This avoids assertion violations when the home
    directory is an empty string for some reason.  (Bug#36363)
---
 src/fileio.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/fileio.c b/src/fileio.c
index b141f56..5dd14da 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -1316,7 +1316,7 @@ the root directory.  */)
 
   /* Now concatenate the directory and name to new space in the stack frame.  
*/
   tlen = length + file_name_as_directory_slop + (nmlim - nm) + 1;
-  eassert (tlen > file_name_as_directory_slop + 1);
+  eassert (tlen >= file_name_as_directory_slop + 1);
 #ifdef DOS_NT
   /* Reserve space for drive specifier and escape prefix, since either
      or both may need to be inserted.  (The Microsoft x86 compiler



reply via email to

[Prev in Thread] Current Thread [Next in Thread]