projects
/
claws.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
831b8da
)
Fix potential out-of-bounds read
author
Ricardo Mones
<ricardo@mones.org>
Fri, 9 Sep 2016 19:27:35 +0000
(21:27 +0200)
committer
Ricardo Mones
<ricardo@mones.org>
Fri, 9 Sep 2016 19:27:35 +0000
(21:27 +0200)
src/plugins/archive/libarchive_archive.c
patch
|
blob
|
history
diff --git
a/src/plugins/archive/libarchive_archive.c
b/src/plugins/archive/libarchive_archive.c
index 5499d1e04f1a0d8da987be33804611f49719402f..018108b30ef66892a2156d74adfd8ffe7a929249 100644
(file)
--- a/
src/plugins/archive/libarchive_archive.c
+++ b/
src/plugins/archive/libarchive_archive.c
@@
-284,18
+284,10
@@
static void archive_add_to_list(struct file_info* file) {
}
static gchar* strip_leading_dot_slash(gchar* path) {
- gchar* stripped = path;
-
gchar* result = NULL
;
+ if (path && strlen(path) > 1 && path[0] == '.' && path[1] == '/')
+
return g_strdup(&(path[2]))
;
- if (stripped && stripped[0] == '.') {
- ++stripped;
- if (stripped && stripped[0] == '/')
- ++stripped;
- result = g_strdup(stripped);
- }
- else
- result = g_strdup(path);
- return result;
+ return g_strdup(path);
}
static gchar* get_full_path(struct file_info* file) {