Parcourir la source

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 il y a 5 ans
Parent
commit
ac0d94217d
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  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;