guacamole-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jmuehl...@apache.org
Subject [1/2] incubator-guacamole-server git commit: GUACAMOLE-303: Ensure there is always space for the null terminator when normalizing.
Date Thu, 06 Jul 2017 02:32:52 GMT
Repository: incubator-guacamole-server
Updated Branches:
  refs/heads/master 07db9808a -> 3fdd1e973


GUACAMOLE-303: Ensure there is always space for the null terminator when normalizing.


Project: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/commit/7857dd0a
Tree: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/tree/7857dd0a
Diff: http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/diff/7857dd0a

Branch: refs/heads/master
Commit: 7857dd0a9ae1097aa1a33d8cbb22058078eb1225
Parents: 07db980
Author: Michael Jumper <mjumper@apache.org>
Authored: Tue Jul 4 12:00:43 2017 -0700
Committer: Michael Jumper <mjumper@apache.org>
Committed: Tue Jul 4 12:00:43 2017 -0700

----------------------------------------------------------------------
 src/common-ssh/sftp.c      | 2 +-
 src/protocols/rdp/rdp_fs.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/7857dd0a/src/common-ssh/sftp.c
----------------------------------------------------------------------
diff --git a/src/common-ssh/sftp.c b/src/common-ssh/sftp.c
index e0e029f..8a53b26 100644
--- a/src/common-ssh/sftp.c
+++ b/src/common-ssh/sftp.c
@@ -77,7 +77,7 @@ static int guac_common_ssh_sftp_normalize_path(char* fullpath,
     strncpy(path_component_data, path, sizeof(path_component_data) - 1);
 
     /* Find path components within path */
-    for (i = 0; i < sizeof(path_component_data); i++) {
+    for (i = 0; i < sizeof(path_component_data) - 1; i++) {
 
         /* If current character is a path separator, parse as component */
         char c = path_component_data[i];

http://git-wip-us.apache.org/repos/asf/incubator-guacamole-server/blob/7857dd0a/src/protocols/rdp/rdp_fs.c
----------------------------------------------------------------------
diff --git a/src/protocols/rdp/rdp_fs.c b/src/protocols/rdp/rdp_fs.c
index 88668d8..ab48cc2 100644
--- a/src/protocols/rdp/rdp_fs.c
+++ b/src/protocols/rdp/rdp_fs.c
@@ -622,10 +622,10 @@ int guac_rdp_fs_normalize_path(const char* path, char* abs_path) {
     path++;
 
     /* Copy path into component data for parsing */
-    strncpy(path_component_data, path, GUAC_RDP_FS_MAX_PATH-1);
+    strncpy(path_component_data, path, sizeof(path_component_data) - 1);
 
     /* Find path components within path */
-    for (i=0; i<GUAC_RDP_FS_MAX_PATH; i++) {
+    for (i = 0; i < sizeof(path_component_data) - 1; i++) {
 
         /* If current character is a path separator, parse as component */
         char c = path_component_data[i];


Mime
View raw message