radare2/shlr/capstone-patches/sstream-null.patch
2017-11-30 00:30:06 +01:00

15 lines
341 B
Diff

diff --git a/SStream.c b/SStream.c
index c90cf1a..1686d5d 100644
--- a/SStream.c
+++ b/SStream.c
@@ -28,6 +28,9 @@ void SStream_Init(SStream *ss)
void SStream_concat0(SStream *ss, char *s)
{
#ifndef CAPSTONE_DIET
+ if (!ss || !s) {
+ return;
+ }
unsigned int len = (unsigned int) strlen(s);
memcpy(ss->buffer + ss->index, s, len);