Переглянути джерело

Release sendBuffer on UA_STATUSCODE_BADRESPONSETOOLARGE

Credit to oss-fuzz
Stefan Profanter 7 роки тому
батько
коміт
df9c7de402
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      src/ua_securechannel.c

+ 3 - 1
src/ua_securechannel.c

@@ -422,8 +422,10 @@ sendChunkSymmetric(UA_ChunkInfo* ci, UA_Byte **buf_pos, const UA_Byte **buf_end)
     if(ci->chunksSoFar > connection->remoteConf.maxChunkCount &&
        connection->remoteConf.maxChunkCount != 0)
         ci->errorCode = UA_STATUSCODE_BADRESPONSETOOLARGE;
-    if(ci->errorCode != UA_STATUSCODE_GOOD)
+    if(ci->errorCode != UA_STATUSCODE_GOOD) {
+        connection->releaseSendBuffer(channel->connection, &ci->messageBuffer);
         return ci->errorCode;
+    }
 
     /* Pad the message. The bytes for the padding and signature were removed
      * from buf_end before encoding the payload. So we don't check here. */