Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
trackrdrd
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
uplex-varnish
trackrdrd
Commits
bb4c5c75
Commit
bb4c5c75
authored
Mar 07, 2013
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trackrdrd: use unsigned indexes in data init (large tables were overflowing)
parent
ac271b54
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
child.c
trackrdrd/src/child.c
+1
-1
data.c
trackrdrd/src/data.c
+3
-3
No files found.
trackrdrd/src/child.c
View file @
bb4c5c75
...
@@ -609,7 +609,7 @@ static inline dataentry
...
@@ -609,7 +609,7 @@ static inline dataentry
de
->
tid
=
fd
;
de
->
tid
=
fd
;
de
->
hasdata
=
false
;
de
->
hasdata
=
false
;
sprintf
(
de
->
data
,
"XID=%
d
"
,
xid
);
sprintf
(
de
->
data
,
"XID=%
u
"
,
xid
);
de
->
end
=
strlen
(
de
->
data
);
de
->
end
=
strlen
(
de
->
data
);
if
(
de
->
end
>
dtbl
.
w_stats
.
data_hi
)
if
(
de
->
end
>
dtbl
.
w_stats
.
data_hi
)
dtbl
.
w_stats
.
data_hi
=
de
->
end
;
dtbl
.
w_stats
.
data_hi
=
de
->
end
;
...
...
trackrdrd/src/data.c
View file @
bb4c5c75
...
@@ -53,13 +53,13 @@ DATA_Init(void)
...
@@ -53,13 +53,13 @@ DATA_Init(void)
dataentry
*
entryptr
;
dataentry
*
entryptr
;
char
*
bufptr
;
char
*
bufptr
;
int
bufsize
=
config
.
maxdata
;
unsigned
bufsize
=
config
.
maxdata
;
/*
/*
* we want enough space to accomodate all open and done records
* we want enough space to accomodate all open and done records
*
*
*/
*/
int
entries
=
(
1
<<
config
.
maxopen_scale
)
+
config
.
maxdone
;
unsigned
entries
=
(
1
<<
config
.
maxopen_scale
)
+
config
.
maxdone
;
entryptr
=
(
dataentry
*
)
calloc
(
entries
,
sizeof
(
dataentry
));
entryptr
=
(
dataentry
*
)
calloc
(
entries
,
sizeof
(
dataentry
));
if
(
entryptr
==
NULL
)
if
(
entryptr
==
NULL
)
...
@@ -82,7 +82,7 @@ DATA_Init(void)
...
@@ -82,7 +82,7 @@ DATA_Init(void)
dtbl
.
buf
=
bufptr
;
dtbl
.
buf
=
bufptr
;
dtbl
.
nfree
=
0
;
dtbl
.
nfree
=
0
;
for
(
int
i
=
0
;
i
<
entries
;
i
++
)
{
for
(
unsigned
i
=
0
;
i
<
entries
;
i
++
)
{
dtbl
.
entry
[
i
].
magic
=
DATA_MAGIC
;
dtbl
.
entry
[
i
].
magic
=
DATA_MAGIC
;
dtbl
.
entry
[
i
].
state
=
DATA_EMPTY
;
dtbl
.
entry
[
i
].
state
=
DATA_EMPTY
;
dtbl
.
entry
[
i
].
hasdata
=
false
;
dtbl
.
entry
[
i
].
hasdata
=
false
;
...
...
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