Hi @Erri ,
A buffer is a contiguous area of computer memory that can hold multiple instances of the same data type, such as a character array. The buffer overflow means that when the computer fills the buffer with the number of data bits, it exceeds the capacity of the buffer itself, and the overflowed data is overlaid on the legal data.
Usually, in an ideal situation, the program checks the data length and does not allow characters that exceed the buffer length. However, since the C language does not have any built-in bounds checking, writing to a character array beyond the end of the array will cause an overflow.
You could try to use the following code to set the buffer size, and change the data type of sizeof(char) to what you need.
char *buffer = malloc(sizeof(char) * 10);
get_bytes (buffer, sizeof(buffer));
The size of the data transmitted by the HTML server can be customized, depending on the settings of the server, the amount of data is usually not too large.
The array that acts as a buffer is not necessarily set to global, it depends on the specific logic of your programThe array that acts as a buffer is not necessarily set to global, it depends on the specific logic of your program.
Best regards,
Elya
If the answer is the right solution, please click "Accept Answer" and upvote it.If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.