Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-gcrypt
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-gcrypt
Commits
09c146d4
Unverified
Commit
09c146d4
authored
Oct 27, 2021
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply the new VCL_INTEGER limits
parent
39a84e09
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
8 deletions
+7
-8
README.rst
README.rst
+2
-2
vmod_gcrypt.c
src/vmod_gcrypt.c
+3
-4
vmod_gcrypt.vcc
src/vmod_gcrypt.vcc
+2
-2
No files found.
README.rst
View file @
09c146d4
...
...
@@ -725,8 +725,8 @@ levels that are described for the ``random()`` function above, except
that the ``VERY_STRONG`` level is not available.
If ``bound`` is less than or equal to 0, then the return value lies
within the entire possible range for an
INT (positive or negative).
The default value of ``bound`` is 0.
within the entire possible range for an
VCL_INT (-999999999999999
.. 999999999999999).
The default value of ``bound`` is 0.
If ``bound`` is greater than 0, then the return value lies between 0
(inclusive) and ``bound`` (exclusive). To get a random integer between
...
...
src/vmod_gcrypt.c
View file @
09c146d4
...
...
@@ -765,10 +765,9 @@ vmod_random_int(VRT_CTX, VCL_ENUM qualitys, VCL_INT bound)
AN
(
qualitys
);
assert
(
qualitys
[
0
]
!=
'V'
);
if
(
bound
<=
0
)
{
get_rnd
(
qualitys
,
&
r
,
sizeof
(
VCL_INT
));
return
r
;
}
if
(
bound
<=
0
)
return
(
vmod_random_int
(
ctx
,
qualitys
,
VRT_INTEGER_MAX
-
VRT_INTEGER_MIN
)
+
VRT_INTEGER_MIN
);
for
(
r
=
bound
;
r
>
0
;
r
>>=
8
)
nbytes
++
;
...
...
src/vmod_gcrypt.vcc
View file @
09c146d4
...
...
@@ -638,8 +638,8 @@ levels that are described for the ``random()`` function above, except
that the ``VERY_STRONG`` level is not available.
If ``bound`` is less than or equal to 0, then the return value lies
within the entire possible range for an
INT (positive or negative).
The default value of ``bound`` is 0.
within the entire possible range for an
VCL_INT (-999999999999999
.. 999999999999999).
The default value of ``bound`` is 0.
If ``bound`` is greater than 0, then the return value lies between 0
(inclusive) and ``bound`` (exclusive). To get a random integer between
...
...
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