Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
Sleuthkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IRT
Sleuthkit
Commits
fb5055a2
Commit
fb5055a2
authored
16 years ago
by
Brian Carrier
Browse files
Options
Downloads
Patches
Plain Diff
ISO9660 bug fix (2503552)
parent
92ceec12
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGES.txt
+2
-0
2 additions, 0 deletions
CHANGES.txt
tsk3/fs/iso9660_dent.c
+36
-38
36 additions, 38 deletions
tsk3/fs/iso9660_dent.c
with
38 additions
and
38 deletions
CHANGES.txt
+
2
−
0
View file @
fb5055a2
...
@@ -26,6 +26,8 @@ to meta type). (Bug: 2389901). Reported by Barry Grundy.
...
@@ -26,6 +26,8 @@ to meta type). (Bug: 2389901). Reported by Barry Grundy.
1/11/09: Update: Lots of bug fixes in HFS code from Rob Joyce.
1/11/09: Update: Lots of bug fixes in HFS code from Rob Joyce.
1/12/09: Bug Fix: Fixed ISO9660 bug where large directory contents were not displayed. (Bug: 2503552). Reported by Tom Black.
---------------- VERSION 3.0.0 --------------
---------------- VERSION 3.0.0 --------------
0/00/00: Update: Many, many, many API changes.
0/00/00: Update: Many, many, many API changes.
...
...
This diff is collapsed.
Click to expand it.
tsk3/fs/iso9660_dent.c
+
36
−
38
View file @
fb5055a2
...
@@ -76,10 +76,11 @@
...
@@ -76,10 +76,11 @@
uint8_t
uint8_t
iso9660_proc_dir
(
TSK_FS_INFO
*
a_fs
,
TSK_FS_DIR
*
a_fs_dir
,
char
*
buf
,
iso9660_proc_dir
(
TSK_FS_INFO
*
a_fs
,
TSK_FS_DIR
*
a_fs_dir
,
char
*
buf
,
size_t
length
,
TSK_INUM_T
a_addr
)
size_t
a_
length
,
TSK_INUM_T
a_addr
)
{
{
ISO_INFO
*
iso
=
(
ISO_INFO
*
)
a_fs
;
ISO_INFO
*
iso
=
(
ISO_INFO
*
)
a_fs
;
TSK_FS_NAME
*
fs_name
;
TSK_FS_NAME
*
fs_name
;
size_t
buf_idx
;
iso9660_dentry
*
dd
;
/* directory descriptor */
iso9660_dentry
*
dd
;
/* directory descriptor */
iso9660_inode_node
*
in
;
iso9660_inode_node
*
in
;
...
@@ -87,7 +88,8 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
...
@@ -87,7 +88,8 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
if
((
fs_name
=
tsk_fs_name_alloc
(
ISO9660_MAXNAMLEN
+
1
,
0
))
==
NULL
)
if
((
fs_name
=
tsk_fs_name_alloc
(
ISO9660_MAXNAMLEN
+
1
,
0
))
==
NULL
)
return
TSK_ERR
;
return
TSK_ERR
;
dd
=
(
iso9660_dentry
*
)
buf
;
buf_idx
=
0
;
dd
=
(
iso9660_dentry
*
)
&
buf
[
buf_idx
];
/* handle "." entry */
/* handle "." entry */
fs_name
->
meta_addr
=
a_addr
;
fs_name
->
meta_addr
=
a_addr
;
...
@@ -97,8 +99,13 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
...
@@ -97,8 +99,13 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
tsk_fs_dir_add
(
a_fs_dir
,
fs_name
);
tsk_fs_dir_add
(
a_fs_dir
,
fs_name
);
length
-=
dd
->
entry_len
;
buf_idx
+=
dd
->
entry_len
;
dd
=
(
iso9660_dentry
*
)
((
char
*
)
dd
+
dd
->
entry_len
);
if
(
buf_idx
>
a_length
-
sizeof
(
iso9660_dentry
))
{
free
(
buf
);
tsk_fs_name_free
(
fs_name
);
return
TSK_OK
;
}
dd
=
(
iso9660_dentry
*
)
&
buf
[
buf_idx
];
/* handle ".." entry */
/* handle ".." entry */
in
=
iso
->
in_list
;
in
=
iso
->
in_list
;
...
@@ -115,15 +122,17 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
...
@@ -115,15 +122,17 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
tsk_fs_dir_add
(
a_fs_dir
,
fs_name
);
tsk_fs_dir_add
(
a_fs_dir
,
fs_name
);
}
}
length
-=
dd
->
entry_len
;
buf_idx
+=
dd
->
entry_len
;
dd
=
(
iso9660_dentry
*
)
((
char
*
)
dd
+
dd
->
entry_len
);
// process the rest of the entries in the directory
// process the rest of the entries in the directory
while
(
length
>
sizeof
(
iso9660_dentry
))
{
while
(
buf_idx
<
a_length
-
sizeof
(
iso9660_dentry
))
{
if
(
dd
->
entry_len
)
{
dd
=
(
iso9660_dentry
*
)
&
buf
[
buf_idx
];
// process the entry (if it has a defined and valid length)
if
((
dd
->
entry_len
)
&&
(
buf_idx
+
dd
->
entry_len
<
a_length
))
{
int
i
;
int
i
;
// find the
entry in our list of files
// find the
corresponding entry in the inode/file list
in
=
iso
->
in_list
;
in
=
iso
->
in_list
;
while
((
in
)
while
((
in
)
&&
(
tsk_getu32
(
a_fs
->
endian
,
&&
(
tsk_getu32
(
a_fs
->
endian
,
...
@@ -132,15 +141,15 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
...
@@ -132,15 +141,15 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
in
=
in
->
next
;
in
=
in
->
next
;
}
}
// we may have not found it because we are reading corrupt data...
if
((
!
in
)
if
((
!
in
)
||
(
tsk_getu32
(
a_fs
->
endian
,
||
(
tsk_getu32
(
a_fs
->
endian
,
in
->
inode
.
dr
.
ext_loc_m
)
!=
tsk_getu32
(
a_fs
->
endian
,
in
->
inode
.
dr
.
ext_loc_m
)
!=
tsk_getu32
(
a_fs
->
endian
,
dd
->
ext_loc_m
)))
{
dd
->
ext_loc_m
)))
{
// @@@
buf_idx
++
;
return
TSK_COR
;
continue
;
}
}
fs_name
->
meta_addr
=
in
->
inum
;
fs_name
->
meta_addr
=
in
->
inum
;
strncpy
(
fs_name
->
name
,
in
->
inode
.
fn
,
ISO9660_MAXNAMLEN
);
strncpy
(
fs_name
->
name
,
in
->
inode
.
fn
,
ISO9660_MAXNAMLEN
);
...
@@ -160,27 +169,24 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
...
@@ -160,27 +169,24 @@ iso9660_proc_dir(TSK_FS_INFO * a_fs, TSK_FS_DIR * a_fs_dir, char *buf,
tsk_fs_dir_add
(
a_fs_dir
,
fs_name
);
tsk_fs_dir_add
(
a_fs_dir
,
fs_name
);
length
-=
dd
->
entry_len
;
buf_idx
+=
dd
->
entry_len
;
dd
=
(
iso9660_dentry
*
)
((
char
*
)
dd
+
dd
->
entry_len
);
/* we need to look for files past the next NULL we discover, in case
* directory has a hole in it (this is common) */
}
}
/* If the length was not defined, we are probably in a hole in the
* directory. The contents are block aligned. So, we
* scan ahead until we get either a non-zero entry or the block boundary */
else
{
else
{
char
*
a
,
*
b
;
length
-=
sizeof
(
iso9660_dentry
);
/* find next non-zero byte and we'll start over there */
a
=
(
char
*
)
dd
;
b
=
a
+
sizeof
(
iso9660_dentry
);
while
((
*
a
==
0
)
&&
(
a
!=
b
))
while
(
buf_idx
<
a_length
-
sizeof
(
iso9660_dentry
))
{
a
++
;
if
(
buf
[
buf_idx
]
!=
0
)
{
dd
=
(
iso9660_dentry
*
)
&
buf
[
buf_idx
];
if
(
a
!=
b
)
{
if
((
dd
->
entry_len
)
length
+=
(
int
)
(
b
-
a
);
&&
(
buf_idx
+
dd
->
entry_len
<
a_length
))
dd
=
(
iso9660_dentry
*
)
((
char
*
)
dd
+
break
;
(
sizeof
(
iso9660_dentry
)
-
(
int
)
(
b
-
a
)));
}
if
(
buf_idx
%
a_fs
->
block_size
==
0
)
break
;
buf_idx
++
;
}
}
}
}
}
}
...
@@ -211,11 +217,9 @@ iso9660_dir_open_meta(TSK_FS_INFO * a_fs, TSK_FS_DIR ** a_fs_dir,
...
@@ -211,11 +217,9 @@ iso9660_dir_open_meta(TSK_FS_INFO * a_fs, TSK_FS_DIR ** a_fs_dir,
{
{
TSK_RETVAL_ENUM
retval
;
TSK_RETVAL_ENUM
retval
;
TSK_FS_DIR
*
fs_dir
;
TSK_FS_DIR
*
fs_dir
;
TSK_OFF_T
offs
;
/* where we are reading in the file */
ssize_t
cnt
;
ssize_t
cnt
;
char
*
buf
;
char
*
buf
;
size_t
length
;
size_t
length
;
ISO_INFO
*
iso
=
(
ISO_INFO
*
)
a_fs
;
if
(
a_addr
<
a_fs
->
first_inum
||
a_addr
>
a_fs
->
last_inum
)
{
if
(
a_addr
<
a_fs
->
first_inum
||
a_addr
>
a_fs
->
last_inum
)
{
tsk_error_reset
();
tsk_error_reset
();
...
@@ -259,12 +263,6 @@ iso9660_dir_open_meta(TSK_FS_INFO * a_fs, TSK_FS_DIR ** a_fs_dir,
...
@@ -259,12 +263,6 @@ iso9660_dir_open_meta(TSK_FS_INFO * a_fs, TSK_FS_DIR ** a_fs_dir,
return
TSK_COR
;
return
TSK_COR
;
}
}
/* calculate directory extent location */
offs
=
(
TSK_OFF_T
)
(
a_fs
->
block_size
*
tsk_getu32
(
a_fs
->
endian
,
iso
->
dinode
->
dr
.
ext_loc_m
));
/* read directory extent into memory */
/* read directory extent into memory */
length
=
(
size_t
)
fs_dir
->
fs_file
->
meta
->
size
;
length
=
(
size_t
)
fs_dir
->
fs_file
->
meta
->
size
;
if
((
buf
=
tsk_malloc
(
length
))
==
NULL
)
if
((
buf
=
tsk_malloc
(
length
))
==
NULL
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment