Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
libwebsockets
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Fork
libwebsockets
Commits
8007cc68
Commit
8007cc68
authored
Mar 18, 2016
by
Andy Green
Browse files
Options
Downloads
Patches
Plain Diff
b64decode correct decode of some strings
https://github.com/warmcat/libwebsockets/issues/467
Signed-off-by:
Andy Green
<
andy@warmcat.com
>
parent
7bc87ab6
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/base64-decode.c
+11
-9
11 additions, 9 deletions
lib/base64-decode.c
with
11 additions
and
9 deletions
lib/base64-decode.c
+
11
−
9
View file @
8007cc68
...
@@ -99,7 +99,7 @@ LWS_VISIBLE int
...
@@ -99,7 +99,7 @@ LWS_VISIBLE int
lws_b64_decode_string
(
const
char
*
in
,
char
*
out
,
int
out_size
)
lws_b64_decode_string
(
const
char
*
in
,
char
*
out
,
int
out_size
)
{
{
int
len
;
int
len
;
int
i
;
int
i
,
c
;
int
done
=
0
;
int
done
=
0
;
unsigned
char
v
;
unsigned
char
v
;
unsigned
char
quad
[
4
];
unsigned
char
quad
[
4
];
...
@@ -110,20 +110,20 @@ lws_b64_decode_string(const char *in, char *out, int out_size)
...
@@ -110,20 +110,20 @@ lws_b64_decode_string(const char *in, char *out, int out_size)
for
(
i
=
0
;
i
<
4
&&
*
in
;
i
++
)
{
for
(
i
=
0
;
i
<
4
&&
*
in
;
i
++
)
{
v
=
0
;
v
=
0
;
c
=
0
;
while
(
*
in
&&
!
v
)
{
while
(
*
in
&&
!
v
)
{
c
=
v
=
*
in
++
;
v
=
*
in
++
;
v
=
(
v
<
43
||
v
>
122
)
?
0
:
decode
[
v
-
43
];
v
=
(
v
<
43
||
v
>
122
)
?
0
:
decode
[
v
-
43
];
if
(
v
)
if
(
v
)
v
=
(
v
==
'$'
)
?
0
:
v
-
61
;
v
=
(
v
==
'$'
)
?
0
:
v
-
61
;
if
(
*
in
)
{
}
if
(
c
)
{
len
++
;
len
++
;
if
(
v
)
if
(
v
)
quad
[
i
]
=
v
-
1
;
quad
[
i
]
=
v
-
1
;
}
else
}
else
quad
[
i
]
=
0
;
quad
[
i
]
=
0
;
}
}
}
if
(
out_size
<
(
done
+
len
-
1
))
if
(
out_size
<
(
done
+
len
-
1
))
/* out buffer is too small */
/* out buffer is too small */
...
@@ -147,6 +147,7 @@ lws_b64_decode_string(const char *in, char *out, int out_size)
...
@@ -147,6 +147,7 @@ lws_b64_decode_string(const char *in, char *out, int out_size)
return
done
;
return
done
;
}
}
#if 0
int
int
lws_b64_selftest(void)
lws_b64_selftest(void)
{
{
...
@@ -183,3 +184,4 @@ lws_b64_selftest(void)
...
@@ -183,3 +184,4 @@ lws_b64_selftest(void)
return 0;
return 0;
}
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment