Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-vtstor
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
libvmod-vtstor
Commits
a3d2ec3d
Commit
a3d2ec3d
authored
Feb 09, 2015
by
Julian Wiesener
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix off by one
parent
b0ffe9a6
Pipeline
#15
skipped
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
vtstor.c
src/vtstor.c
+4
-4
No files found.
src/vtstor.c
View file @
a3d2ec3d
...
...
@@ -152,7 +152,7 @@ static int vtstor_set_key(struct vmod_vtstor_vtstor *vmi, struct vtstor_node *no
{
CHECK_OBJ_NOTNULL
(
vmi
,
VMOD_VTSTOR_VTSTOR_MAGIC
);
CHECK_OBJ_NOTNULL
(
node
,
VMOD_VTSTOR_NODE_MAGIC
);
size_t
size
=
strlen
(
s
);
size_t
size
=
strlen
(
s
)
+
1
;
if
(
size
>
vmi
->
key_max
)
return
0
;
if
(
node
->
key
)
{
...
...
@@ -163,7 +163,7 @@ static int vtstor_set_key(struct vmod_vtstor_vtstor *vmi, struct vtstor_node *no
vmi
->
dealloc
(
vmi
,
&
node
->
key
);
}
node
->
key_capacity
=
vmi
->
alloc
(
vmi
,
size
,
&
node
->
key
);
if
(
node
->
key_capacity
)
if
(
node
->
key_capacity
>=
size
)
strcpy
(
node
->
key
,
s
);
return
node
->
key_capacity
;
}
...
...
@@ -172,7 +172,7 @@ static int vtstor_set_value(struct vmod_vtstor_vtstor *vmi, struct vtstor_node *
{
CHECK_OBJ_NOTNULL
(
vmi
,
VMOD_VTSTOR_VTSTOR_MAGIC
);
CHECK_OBJ_NOTNULL
(
node
,
VMOD_VTSTOR_NODE_MAGIC
);
size_t
size
=
strlen
(
s
);
size_t
size
=
strlen
(
s
)
+
1
;
if
(
size
>
vmi
->
value_max
)
return
0
;
if
(
node
->
value
)
{
...
...
@@ -183,7 +183,7 @@ static int vtstor_set_value(struct vmod_vtstor_vtstor *vmi, struct vtstor_node *
vmi
->
dealloc
(
vmi
,
&
node
->
value
);
}
node
->
value_capacity
=
vmi
->
alloc
(
vmi
,
size
,
&
node
->
value
);
if
(
node
->
value_capacity
)
if
(
node
->
value_capacity
>=
size
)
strcpy
(
node
->
value
,
s
);
return
node
->
value_capacity
;
}
...
...
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