Changeset: 37f6164d366e for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=37f6164d366e
Modified Files:
        monetdb5/extras/jaql/json.c
Branch: Jul2012
Log Message:

read_from_stream: don't dereference recall if it's NULL (Coverity)

This could be a potential crash.


diffs (12 lines):

diff --git a/monetdb5/extras/jaql/json.c b/monetdb5/extras/jaql/json.c
--- a/monetdb5/extras/jaql/json.c
+++ b/monetdb5/extras/jaql/json.c
@@ -127,7 +127,7 @@ read_from_stream(jsonbat *jb, char **pos
 
        shift = *pos - jb->streambuf;
        if (*pos == jb->streambuf + jb->streambuflen - 1) {
-               size_t rshift = *recall - jb->streambuf;
+               size_t rshift = recall != NULL ? *recall - jb->streambuf : 0;
                char *newbuf = realloc(jb->streambuf, jb->streambuflen += 8096);
                if (newbuf == NULL)
                        return 0;
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to