test742: test SOCKS5 with max length user, password and hostname

Adjusted the socksd server accordingly to allow for configuring that
long user name and password.

Closes #12797
This commit is contained in:
Daniel Stenberg 2024-01-25 22:14:53 +01:00
parent 6d85228709
commit cc42b008d5
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 71 additions and 5 deletions

View file

@ -193,8 +193,8 @@ static void getconfig(void)
logmsg("parse config file");
while(fgets(buffer, sizeof(buffer), fp)) {
char key[32];
char value[32];
if(2 == sscanf(buffer, "%31s %31s", key, value)) {
char value[260];
if(2 == sscanf(buffer, "%31s %259s", key, value)) {
if(!strcmp(key, "version")) {
config.version = byteval(value);
logmsg("version [%d] set", config.version);
@ -365,8 +365,8 @@ static curl_socket_t socks4(curl_socket_t fd,
static curl_socket_t sockit(curl_socket_t fd)
{
unsigned char buffer[256 + 16];
unsigned char response[256 + 16];
unsigned char buffer[2*256 + 16];
unsigned char response[2*256 + 16];
ssize_t rc;
unsigned char len;
unsigned char type;