[file-roller] Pointer arithmetic fixes for end of string access



commit 3d7fa24ca267e333d7406eff38ec02b519110ecc
Author: Iain Nicol <iainn src gnome org>
Date:   Sun May 29 22:50:58 2011 +0100

    Pointer arithmetic fixes for end of string access
    
    [bug #651416]

 src/fr-command-7z.c |    2 +-
 src/fr-window.c     |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/fr-command-7z.c b/src/fr-command-7z.c
index 3f66338..5e505fa 100644
--- a/src/fr-command-7z.c
+++ b/src/fr-command-7z.c
@@ -158,7 +158,7 @@ list__process_line (char     *line,
 		fdata->original_path = g_strdup (fields[1]);
 		fdata->full_path = g_strconcat ((fdata->original_path[0] != '/') ? "/" : "",
 						fdata->original_path,
-						(fdata->dir && (fdata->original_path[strlen (fdata->original_path - 1)] != '/')) ? "/" : "",
+						(fdata->dir && (fdata->original_path[strlen (fdata->original_path) - 1] != '/')) ? "/" : "",
 						NULL);
 	}
 	else if (strcmp (fields[0], "Folder") == 0) {
diff --git a/src/fr-window.c b/src/fr-window.c
index 743c8fe..db8c8c6 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -1236,7 +1236,7 @@ fr_window_dir_exists_in_archive (FrWindow   *window,
 			return TRUE;
 		}
 		else if (fdata->dir
-			 && (fdata->full_path[strlen (fdata->full_path)] != '/')
+			 && (fdata->full_path[strlen (fdata->full_path) - 1] != '/')
 			 && (strncmp (dir_name, fdata->full_path, dir_name_len - 1) == 0))
 		{
 			return TRUE;



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