[git] GPGME - branch, master, updated. gpgme-1.11.1-112-g974a95d

[email protected] (by Andre Heinecke)
Newsgroups gmane.comp.encryption.gpg.cvs
Message-ID <[email protected]>
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, master has been updated
       via  974a95db04f9cdea02867f0246445b4679517ba0 (commit)
      from  6e48bb0f1cbf662026bf0f70549b52bafe00c017 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 974a95db04f9cdea02867f0246445b4679517ba0
Author: Andre Heinecke <[email protected]>
Date:   Wed Aug 8 13:30:01 2018 +0200

    json: Add checks when skipping byte
    
    * src/cJSON.c (parse_string, cJSON_Minify): Check for
    terminating NULL byte when skipping the byte after a an escaped
    quote.

diff --git a/src/cJSON.c b/src/cJSON.c
index 65d105b..eea1adf 100644
--- a/src/cJSON.c
+++ b/src/cJSON.c
@@ -249,7 +249,7 @@ parse_string (cJSON * item, const char *str, const char **ep)
     }				/* not a string! */
 
   while (*ptr != '\"' && *ptr && ++len)
-    if (*ptr++ == '\\')
+    if (*ptr++ == '\\' && *ptr)
       ptr++;			/* Skip escaped quotes. */
 
   out = xtrymalloc (len + 2);	/* This is how long we need for the
@@ -268,6 +268,8 @@ parse_string (cJSON * item, const char *str, const char **ep)
       else
 	{
 	  ptr++;
+          if (!*ptr)
+            break;
 	  switch (*ptr)
 	    {
 	    case 'b':
@@ -1416,9 +1418,11 @@ cJSON_Minify (char *json)
 	    {
 	      if (*json == '\\')
 		*into++ = *json++;
-	      *into++ = *json++;
+	      if (*json)
+	        *into++ = *json++;
 	    }
-	  *into++ = *json++;
+          if (*json)
+            *into++ = *json++;
 	}			/* String literals, which are \" sensitive.  */
       else
 	*into++ = *json++;	/* All other characters.  */

-----------------------------------------------------------------------

Summary of changes:
 src/cJSON.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.