You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If a browser send more than 255 char (buffer size) or missing some \n stuff, the buffer could be not terminated by 0, this crashe the string manipulation after and stop the application
Always more robust when we work with string to assure that a zero exists somewhere marking the end of the string.
I added the 3 lines in the code below all is working fine on my side now ;-)
Charles
if (client)
{
// reset input buffer
index = 0;
// Added clearing buffer starting clean
// ===========================
for (int i = 0; i < (sizeof(clientline)); i++)
clientline[i] = '\0';
...
...
// fill url the buffer
if(c != '\n' && c != '\r' && index < BUFSIZE)
{
clientline[index++] = c;
continue;
}
// Add this new line at this point
// =====================
clientline[index] = '\0' ;
The text was updated successfully, but these errors were encountered:
Hi guys
If a browser send more than 255 char (buffer size) or missing some \n stuff, the buffer could be not terminated by 0, this crashe the string manipulation after and stop the application
Always more robust when we work with string to assure that a zero exists somewhere marking the end of the string.
I added the 3 lines in the code below all is working fine on my side now ;-)
Charles
if (client)
{
// reset input buffer
index = 0;
// Added clearing buffer starting clean
// ===========================
for (int i = 0; i < (sizeof(clientline)); i++)
clientline[i] = '\0';
...
...
// fill url the buffer
if(c != '\n' && c != '\r' && index < BUFSIZE)
{
clientline[index++] = c;
continue;
}
// Add this new line at this point
// =====================
clientline[index] = '\0' ;
The text was updated successfully, but these errors were encountered: