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
c47dcc40
Commit
c47dcc40
authored
Aug 12, 2016
by
Nils Goroll
1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
set ENOMEM consistently (I hope everywhere)
parent
c1dc185c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
4 deletions
+12
-4
hex.c
src/hex.c
+3
-1
id.c
src/id.c
+3
-1
url.c
src/url.c
+6
-2
No files found.
src/hex.c
View file @
c47dcc40
...
...
@@ -84,8 +84,10 @@ hex_encode(const enum encoding enc, char *restrict const buf,
assert
(
enc
==
HEXUC
||
enc
==
HEXLC
);
if
(
in
==
NULL
||
inlen
==
0
)
return
0
;
if
(
buflen
<
hex_encode_l
(
inlen
))
if
(
buflen
<
hex_encode_l
(
inlen
))
{
errno
=
ENOMEM
;
return
-
1
;
}
if
(
enc
!=
HEXLC
)
alphabet
=
hex_alphabet
[
1
];
...
...
src/id.c
View file @
c47dcc40
...
...
@@ -55,8 +55,10 @@ id_encode(const enum encoding enc, char *restrict const buf,
(
void
)
enc
;
AN
(
buf
);
if
(
buflen
<
inlen
+
1
)
if
(
buflen
<
inlen
+
1
)
{
errno
=
ENOMEM
;
return
-
1
;
}
if
(
in
==
NULL
||
inlen
==
0
)
return
0
;
...
...
src/url.c
View file @
c47dcc40
...
...
@@ -95,13 +95,17 @@ url_encode(const enum encoding enc, char *restrict const buf,
for
(
int
i
=
0
;
i
<
inlen
;
i
++
)
{
if
(
isunreserved
(
in
[
i
]))
{
if
(
p
==
end
)
if
(
p
==
end
)
{
errno
=
ENOMEM
;
return
-
1
;
}
*
p
++
=
in
[
i
];
}
else
{
if
(
p
+
3
>
end
)
if
(
p
+
3
>
end
)
{
errno
=
ENOMEM
;
return
-
1
;
}
*
p
++
=
'%'
;
*
p
++
=
alphabet
[(
in
[
i
]
&
0xf0
)
>>
4
];
*
p
++
=
alphabet
[
in
[
i
]
&
0x0f
];
...
...
Geoff Simmons
@geoff
mentioned in commit
47595927
·
Sep 30, 2016
mentioned in commit
47595927
mentioned in commit 47595927d2a229411962142239f5145f2e839892
Toggle commit list
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