浏览代码

Stack: Correctly pass pointer to encoding for DiagnosticInfo

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=12889

Credit to oss-fuzz
Stefan Profanter 5 年之前
父节点
当前提交
ac0d94217d
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      src/ua_types_encoding_binary.c

+ 2 - 1
src/ua_types_encoding_binary.c

@@ -1251,7 +1251,8 @@ ENCODE_BINARY(DiagnosticInfo) {
 
     /* Encode the inner diagnostic info */
     if(src->hasInnerDiagnosticInfo)
-        ret = ENCODE_WITHEXCHANGE(&src->innerDiagnosticInfo,
+    	// innerDiagnosticInfo is already a pointer, so don't use the & reference here
+        ret = ENCODE_WITHEXCHANGE(src->innerDiagnosticInfo,
                                   UA_TYPES_DIAGNOSTICINFO);
 
     return ret;