You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2021/10/29 19:41:18 UTC

[qpid-proton] 04/04: PROTON-2446: escape quotemarks when they appear in dumped data

This is an automated email from the ASF dual-hosted git repository.

astitcher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/qpid-proton.git

commit f34c8a251da84a6c6f9a5ba03e746e8ee60ee6a3
Author: Andrew Stitcher <as...@apache.org>
AuthorDate: Wed Oct 6 23:03:30 2021 -0400

    PROTON-2446: escape quotemarks when they appear in dumped data
---
 c/src/core/util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/c/src/core/util.c b/c/src/core/util.c
index 70a3fe6..ced44ae 100644
--- a/c/src/core/util.c
+++ b/c/src/core/util.c
@@ -40,8 +40,8 @@ ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size)
   for (unsigned i = 0; i < size; i++)
   {
     uint8_t c = src[i];
-    // output printable ASCII, ensure '\' always introduces hex escape
-    if (c < 128 && c != '\\' && isprint(c)) {
+    // output printable ASCII, ensure '\' always introduces hex escape, escape quote marks
+    if (c < 128 && c != '\\' && c != '\"' && c != '\'' && isprint(c)) {
       if (idx < (int) (capacity - 1)) {
         dst[idx++] = c;
       } else {

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org