Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvmod-blobcode
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
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-blobcode
Commits
c1dc185c
Commit
c1dc185c
authored
Aug 12, 2016
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix buffer size check in base64_encode()
parent
4aa14a09
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
2 deletions
+7
-2
base64.c
src/base64.c
+7
-2
No files found.
src/base64.c
View file @
c1dc185c
...
@@ -91,9 +91,14 @@ base64_encode(const enum encoding enc, char *restrict const buf,
...
@@ -91,9 +91,14 @@ base64_encode(const enum encoding enc, char *restrict const buf,
AN
(
alpha
);
AN
(
alpha
);
if
(
in
==
NULL
||
inlength
==
0
)
if
(
in
==
NULL
||
inlength
==
0
)
return
0
;
return
0
;
if
((
enc
!=
BASE64URLNOPAD
&&
buflen
<
base64_encode_l
(
inlength
))
||
buflen
<
base64nopad_encode_l
(
inlength
))
if
((
enc
==
BASE64URLNOPAD
&&
buflen
<
base64nopad_encode_l
(
inlength
))
||
(
enc
!=
BASE64URLNOPAD
&&
buflen
<
base64_encode_l
(
inlength
)))
{
errno
=
ENOMEM
;
return
-
1
;
return
-
1
;
}
while
(
end
-
in
>=
3
)
{
while
(
end
-
in
>=
3
)
{
*
p
++
=
alpha
->
b64
[(
in
[
0
]
>>
2
)
&
0x3f
];
*
p
++
=
alpha
->
b64
[(
in
[
0
]
>>
2
)
&
0x3f
];
...
...
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