Download tasks/csa159/pair_138203/patch.diff from Benchanything/checkerbench: direct link, hf CLI and curl.
- Browser
- Download file 1.77 kB
-
https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/csa159/pair_138203/patch.diff
- Command line
-
hf download hf://datasets/Benchanything/checkerbench/tasks/csa159/pair_138203/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benchanything/checkerbench/resolve/main/tasks/csa159/pair_138203/patch.diff
1.77 kB
| diff --git a/src/libvncserver/httpd.c b/src/libvncserver/httpd.c | |
| index f4fe51c..7cefadc 100644 | |
| --- a/src/libvncserver/httpd.c | |
| +++ b/src/libvncserver/httpd.c | |
| httpProcessInput(rfbScreenInfoPtr rfbScreen) | |
| /* Process the request. */ | |
| - if(rfbScreen->httpEnableProxyConnect) { | |
| +if(rfbScreen->httpEnableProxyConnect) { | |
| const static char* PROXY_OK_STR = "HTTP/1.0 200 OK\r\nContent-Type: octet-stream\r\nPragma: no-cache\r\n\r\n"; | |
| if(!strncmp(buf, "CONNECT ", 8)) { | |
| - if(atoi(strchr(buf, ':')+1)!=rfbScreen->port) { | |
| + char *colon = strchr(buf, ':'); | |
| + if(colon == NULL || atoi(colon+1)!=rfbScreen->port) { | |
| rfbErr("httpd: CONNECT format invalid.\n"); | |
| rfbWriteExact(&cl,INVALID_REQUEST_STR, strlen(INVALID_REQUEST_STR)); | |
| httpCloseSock(rfbScreen); | |
| httpProcessInput(rfbScreenInfoPtr rfbScreen) | |
| rfbScreen->httpSock = RFB_INVALID_SOCKET; | |
| return; | |
| } | |
| - if (!strncmp(buf, "GET ",4) && !strncmp(strchr(buf,'/'),"/proxied.connection HTTP/1.", 27)) { | |
| - /* proxy connection */ | |
| - rfbLog("httpd: client asked for /proxied.connection\n"); | |
| - rfbWriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR)); | |
| - rfbNewClientConnection(rfbScreen,rfbScreen->httpSock); | |
| - rfbScreen->httpSock = RFB_INVALID_SOCKET; | |
| - return; | |
| - } | |
| + if (!strncmp(buf, "GET ",4)) { | |
| + char *slash = strchr(buf, '/'); | |
| + if (slash != NULL && !strncmp(slash,"/proxied.connection HTTP/1.", 27)) { | |
| + /* proxy connection */ | |
| + rfbLog("httpd: client asked for /proxied.connection\n"); | |
| + rfbWriteExact(&cl,PROXY_OK_STR,strlen(PROXY_OK_STR)); | |
| + rfbNewClientConnection(rfbScreen,rfbScreen->httpSock); | |
| + rfbScreen->httpSock = RFB_INVALID_SOCKET; | |
| + return; | |
| + } | |
| + } | |
| } | |
| if (strncmp(buf, "GET ", 4)) { |