mirror of
				https://github.com/luc-github/ESP3D.git
				synced 2025-10-24 11:50:52 -07:00 
			
		
		
		
	Add some sanity check to avoid buffer overflow
This commit is contained in:
		| @@ -268,6 +268,10 @@ size_t WebSocket_Server::writeBytes(const uint8_t *buffer, size_t size) { | ||||
|     } | ||||
|     // need periodic check to force to flush in case of no end | ||||
|     for (uint i = 0; i < size; i++) { | ||||
|       //add a sanity check to avoid buffer overflow | ||||
|       if (_TXbufferSize >= TXBUFFERSIZE) { | ||||
|         flushTXbuffer(); | ||||
|       } | ||||
|       _TXbuffer[_TXbufferSize] = buffer[i]; | ||||
|       _TXbufferSize++; | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user