Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblongpath-rsync
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
liblongpath
liblongpath-rsync
Commits
a1d55ad0
Commit
a1d55ad0
authored
Feb 02, 2004
by
Wayne Davison
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make sure that the idev struct's data is 4-byte aligned.
parent
a289addd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
8 deletions
+20
-8
flist.c
flist.c
+20
-8
No files found.
flist.c
View file @
a1d55ad0
...
...
@@ -497,7 +497,8 @@ void receive_file_entry(struct file_struct **fptr, unsigned short flags, int f)
static
int
lastdir_len
=
-
1
;
char
thisname
[
MAXPATHLEN
];
unsigned
int
l1
=
0
,
l2
=
0
;
int
alloc_len
,
basename_len
,
dirname_len
,
linkname_len
,
sum_len
,
idev_len
;
int
alloc_len
,
basename_len
,
dirname_len
,
linkname_len
,
sum_len
;
int
idev_len
,
idev_pad
;
OFF_T
file_length
;
char
*
basename
,
*
dirname
,
*
bp
;
struct
file_struct
*
file
;
...
...
@@ -603,7 +604,12 @@ void receive_file_entry(struct file_struct **fptr, unsigned short flags, int f)
sum_len
=
always_checksum
&&
S_ISREG
(
mode
)
?
MD4_SUM_LENGTH
:
0
;
alloc_len
=
sizeof
file
[
0
]
+
dirname_len
+
basename_len
+
linkname_len
+
sum_len
+
idev_len
;
+
linkname_len
+
sum_len
;
if
(
idev_len
)
{
idev_pad
=
(
4
-
(
alloc_len
%
4
))
%
4
;
alloc_len
+=
idev_pad
+
idev_len
;
}
else
idev_pad
=
0
;
if
(
!
(
bp
=
new_array
(
char
,
alloc_len
)))
out_of_memory
(
"receive_file_entry"
);
file
=
*
fptr
=
(
struct
file_struct
*
)
bp
;
...
...
@@ -645,8 +651,8 @@ void receive_file_entry(struct file_struct **fptr, unsigned short flags, int f)
#if SUPPORT_HARD_LINKS
if
(
idev_len
)
{
file
->
link_u
.
idev
=
(
struct
idev
*
)
bp
;
bp
+=
idev_len
;
file
->
link_u
.
idev
=
(
struct
idev
*
)
(
bp
+
idev_pad
)
;
bp
+=
idev_
pad
+
idev_
len
;
if
(
protocol_version
<
26
)
{
dev
=
read_int
(
f
);
file
->
F_INODE
=
read_int
(
f
);
...
...
@@ -708,7 +714,8 @@ struct file_struct *make_file(char *fname, int exclude_level)
char
sum
[
SUM_LENGTH
];
char
thisname
[
MAXPATHLEN
];
char
linkname
[
MAXPATHLEN
];
int
alloc_len
,
basename_len
,
dirname_len
,
linkname_len
,
sum_len
,
idev_len
;
int
alloc_len
,
basename_len
,
dirname_len
,
linkname_len
,
sum_len
;
int
idev_len
,
idev_pad
;
char
*
basename
,
*
dirname
,
*
bp
;
unsigned
short
flags
=
0
;
...
...
@@ -803,7 +810,12 @@ struct file_struct *make_file(char *fname, int exclude_level)
sum_len
=
always_checksum
&&
S_ISREG
(
st
.
st_mode
)
?
MD4_SUM_LENGTH
:
0
;
alloc_len
=
sizeof
file
[
0
]
+
dirname_len
+
basename_len
+
linkname_len
+
sum_len
+
idev_len
;
+
linkname_len
+
sum_len
;
if
(
idev_len
)
{
idev_pad
=
(
4
-
(
alloc_len
%
4
))
%
4
;
alloc_len
+=
idev_pad
+
idev_len
;
}
else
idev_pad
=
0
;
if
(
!
(
bp
=
new_array
(
char
,
alloc_len
)))
out_of_memory
(
"receive_file_entry"
);
file
=
(
struct
file_struct
*
)
bp
;
...
...
@@ -845,8 +857,8 @@ struct file_struct *make_file(char *fname, int exclude_level)
#if SUPPORT_HARD_LINKS
if
(
idev_len
)
{
file
->
link_u
.
idev
=
(
struct
idev
*
)
bp
;
bp
+=
idev_len
;
file
->
link_u
.
idev
=
(
struct
idev
*
)
(
bp
+
idev_pad
)
;
bp
+=
idev_
pad
+
idev_
len
;
file
->
F_DEV
=
st
.
st_dev
;
file
->
F_INODE
=
st
.
st_ino
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment