gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [gnurl] 163/220: scp: fix directory name length used in mem


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 163/220: scp: fix directory name length used in memcpy
Date: Thu, 12 Sep 2019 17:28:43 +0200

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit 25f962193574e35fe638764c3afb9d25d8a9768b
Author: Kyle Abramowitz <address@hidden>
AuthorDate: Thu Aug 22 20:58:26 2019 +0000

    scp: fix directory name length used in memcpy
    
    Fix read off end of array due to bad pointer math in getworkingpath for
    SCP home directory case.
    
    Closes #4258
---
 lib/curl_path.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/curl_path.c b/lib/curl_path.c
index 85dddcef1..f42963463 100644
--- a/lib/curl_path.c
+++ b/lib/curl_path.c
@@ -55,7 +55,7 @@ CURLcode Curl_getworkingpath(struct connectdata *conn,
     }
     if((working_path_len > 3) && (!memcmp(working_path, "/~/", 3)))
       /* It is referenced to the home directory, so strip the leading '/~/' */
-      memcpy(real_path, working_path + 3, 4 + working_path_len-3);
+      memcpy(real_path, working_path + 3, working_path_len - 2);
     else
       memcpy(real_path, working_path, 1 + working_path_len);
   }

-- 
To stop receiving notification emails like this one, please contact
address@hidden.



reply via email to

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