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 2018/07/30 16:34:59 UTC

[5/8] qpid-proton git commit: PROTON-1903: Bug found by OSS Fuzz project - Tell the compiler better about the string tables to avoid asam bounds error

PROTON-1903: Bug found by OSS Fuzz project
- Tell the compiler better about the string tables to avoid asam bounds error

OSS-Fuzz bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8309


Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/62d37225
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/62d37225
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/62d37225

Branch: refs/heads/master
Commit: 62d372256ba539c503063c50f164d2506cdeb80a
Parents: 2f43680
Author: Andrew Stitcher <as...@apache.org>
Authored: Sun Jul 29 00:03:41 2018 -0400
Committer: Andrew Stitcher <as...@apache.org>
Committed: Mon Jul 30 11:40:25 2018 -0400

----------------------------------------------------------------------
 c/src/core/codec.c                                   |   4 ++--
 .../fuzz-connection-driver/crash/6237435934539776    | Bin 0 -> 291 bytes
 2 files changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/62d37225/c/src/core/codec.c
----------------------------------------------------------------------
diff --git a/c/src/core/codec.c b/c/src/core/codec.c
index b4322d7..595a4e6 100644
--- a/c/src/core/codec.c
+++ b/c/src/core/codec.c
@@ -265,7 +265,7 @@ int pni_inspect_enter(void *ctx, pn_data_t *data, pni_node_t *node)
       return 0;
     }
     const char *name = (index < grandfields->field_count)
-        ? FIELD_STRINGPOOL.STRING0+FIELD_FIELDS[grandfields->first_field_index+index]
+        ? (const char*)FIELD_STRINGPOOL.STRING0+FIELD_FIELDS[grandfields->first_field_index+index]
         : NULL;
     if (name) {
       err = pn_string_addf(str, "%s=", name);
@@ -285,7 +285,7 @@ int pni_inspect_enter(void *ctx, pn_data_t *data, pni_node_t *node)
     return pn_string_addf(str, "{");
   default:
     if (fields && index == 0) {
-      err = pn_string_addf(str, "%s", FIELD_STRINGPOOL.STRING0+FIELD_NAME[fields->name_index]);
+      err = pn_string_addf(str, "%s", (const char *)FIELD_STRINGPOOL.STRING0+FIELD_NAME[fields->name_index]);
       if (err) return err;
       err = pn_string_addf(str, "(");
       if (err) return err;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/62d37225/c/tests/fuzz/fuzz-connection-driver/crash/6237435934539776
----------------------------------------------------------------------
diff --git a/c/tests/fuzz/fuzz-connection-driver/crash/6237435934539776 b/c/tests/fuzz/fuzz-connection-driver/crash/6237435934539776
new file mode 100644
index 0000000..0a6e625
Binary files /dev/null and b/c/tests/fuzz/fuzz-connection-driver/crash/6237435934539776 differ


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