Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
hiredis
Commits
297ecbec
Commit
297ecbec
authored
Dec 12, 2020
by
michael-grunder
Browse files
Tiny formatting changes + suppress implicit memcpy warning
parent
f746a28e
Changes
1
Hide whitespace changes
Inline
Side-by-side
fuzzing/format_command_fuzzer.c
View file @
297ecbec
...
...
@@ -32,27 +32,26 @@
*/
#include <stdlib.h>
#include <string.h>
#include "hiredis.h"
int
LLVMFuzzerTestOneInput
(
const
uint8_t
*
data
,
size_t
size
)
{
if
(
size
<
3
)
return
0
;
char
*
new_str
=
malloc
(
size
+
1
);
if
(
new_str
==
NULL
)
return
0
;
char
*
new_str
,
*
cmd
;
char
*
cmd
;
int
len
;
memcpy
(
new_str
,
data
,
size
);
new_str
[
size
]
=
'\0'
;
if
(
size
<
3
)
return
0
;
len
=
redisFormatCommand
(
&
cmd
,
new_str
);
if
(
cmd
!=
NULL
)
hi_free
(
cmd
);
free
(
new_str
);
return
0
;
new_str
=
malloc
(
size
+
1
);
if
(
new_str
==
NULL
)
return
0
;
memcpy
(
new_str
,
data
,
size
);
new_str
[
size
]
=
'\0'
;
redisFormatCommand
(
&
cmd
,
new_str
);
if
(
cmd
!=
NULL
)
hi_free
(
cmd
);
free
(
new_str
);
return
0
;
}
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