Ver código fonte

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 anos atrás
pai
commit
ac0d94217d
1 arquivos alterados com 2 adições e 1 exclusões
  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;