Skip to content

Instantly share code, notes, and snippets.

Avatar
🥌
typos and segfaults

Daniel Stenberg bagder

🥌
typos and segfaults
View GitHub Profile
@bagder
bagder / select.patch
Created Aug 20, 2021
select.c fix for clearing revents
View select.patch
diff --git a/lib/select.c b/lib/select.c
index 52dca5a2c..3be32ceb5 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -344,10 +344,11 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, timediff_t timeout_ms)
for(i = 0; i < nfds; i++) {
if(ufds[i].fd != CURL_SOCKET_BAD) {
fds_none = FALSE;
break;
}
@bagder
bagder / result.txt
Created Jul 5, 2021
scorecard for curl 2021-07-05
View result.txt
Starting [Code-Review]
Starting [Contributors]
Starting [Fuzzing]
Starting [Packaging]
Starting [CI-Tests]
Starting [CII-Best-Practices]
Starting [Frozen-Deps]
Starting [Pull-Requests]
Starting [Security-Policy]
Starting [Signed-Releases]
@bagder
bagder / build-quiche.txt
Created Feb 26, 2021
Feb 26 2021, problems to build quiche with custom boringssl
View build-quiche.txt
$ cd $HOME/src/quiche
$ cat mybuild
QUICHE_BSSL_PATH=$HOME/src/boringssl cargo build --release --features ffi,pkg-config-meta,qlog --verbose
$ cd $HOME/src/boringssl
$ cat mybuild
#!/bin/sh
CXX=g++ CC=gcc cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=release -DBUILD_SHARED_LIBS=1 && cmake --build build
cp ./build/crypto/libcrypto.so ./lib/
cp ./build/ssl/libssl.so ./lib/
@bagder
bagder / http.log
Created Jan 21, 2021
test server response
View http.log
HTTP/1.1 200 OK
Date: Thu, 21 Jan 2021 13:35:13 GMT
Server: Apache/2.4.46 (Debian)
Upgrade: h2c
Connection: Upgrade
Last-Modified: Fri, 20 May 2016 19:39:55 GMT
ETag: "20000000-5334b41606420"
Accept-Ranges: bytes
Content-Length: 536870912
@bagder
bagder / valgrind.patch
Created Oct 15, 2020
valgrind.supp fix for zstd
View valgrind.patch
diff --git a/tests/valgrind.supp b/tests/valgrind.supp
index 10b07314a..4aaeac5b4 100644
--- a/tests/valgrind.supp
+++ b/tests/valgrind.supp
@@ -1,5 +1,13 @@
+{
+ zstd_decompression-1.3.3
+ Memcheck:cond
+ fun:ZSTD_decompressStream
+ obj:/usr/lib/x86_64-linux-gnu/libzstd.so.1.3.3
@bagder
bagder / test360.diff
Created Oct 5, 2020
fix for jfuller's test360
View test360.diff
--- data/test360~ 2020-10-05 07:44:59.291501064 +0200
+++ data/test360 2020-10-05 07:51:34.882694526 +0200
@@ -44,7 +44,7 @@
CURL_ALTSVC_HTTP="yeah"
</setenv>
<command>
---http2 --alt-svc "log/altsvc-360" "http://%HOSTIP:%HTTPSPORT/360" "http://%HOSTIP:%HTTPSPORT/360"
+--http2 --alt-svc "log/altsvc-360" "http://%HOSTIP:%HTTP2PORT/360" "http://%HOSTIP:%HTTP2PORT/360"
</command>
@bagder
bagder / pidfile.patch
Created Jun 5, 2020
patch to fix armv7 test server crash
View pidfile.patch
diff --git a/tests/server/util.c b/tests/server/util.c
index 75f3cb1b6..414d7194f 100644
--- a/tests/server/util.c
+++ b/tests/server/util.c
@@ -288,11 +288,11 @@ int write_pidfile(const char *filename)
*/
pid += 65536;
#endif
fprintf(pidfile, "%" CURL_FORMAT_CURL_OFF_T "\n", pid);
fclose(pidfile);
@bagder
bagder / run-httpsproxy.sh
Created May 13, 2020
run stunnel in front of the HTTP proxy to make you a HTTPS proxy
View run-httpsproxy.sh
#!/bin/sh
cat <<EOF | stunnel -fd 0
cert = $HOME/src/curl/tests/stunnel.pem
pid = `pwd`/stunnel.pid
foreground = yes
output = https-proxy.log
[https-proxy]
connect = 127.0.0.1:80
accept = 127.0.0.1:8843
@bagder
bagder / logfile.txt
Created Apr 22, 2020
gcc-10 -fanalyze complaint on version.c
View logfile.txt
CC libcurl_la-version.lo
version.c: In function ‘curl_version’:
version.c:216:16: warning: use of uninitialized value ‘<unknown>’ [CWE-457] [-Wanalyzer-use-of-uninitialized-value]
216 | size_t n = strlen(src[j]);
| ^~~~~~~~~~~~~~
‘curl_version’: events 1-9
|
| 215 | for(j = 0; j < i; j++) {
| | ^~~
| | |
@bagder
bagder / logfile.txt
Created Apr 20, 2020
test 358 torture fail
View logfile.txt
test 0358...[HTTPS GET translated by alt-svc lookup to HTTP/2 GET]
237 functions to make fail
valgrind ERROR ==2932677== 72 (40 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 3
==2932677== at 0x4838B65: calloc (vg_replace_malloc.c:762)
==2932677== by 0x166D77: curl_dbg_calloc (memdebug.c:205)
==2932677== by 0x154482: Curl_add_buffer_init (http.c:1136)
==2932677== by 0x1575FF: Curl_http (http.c:2575)
==2932677== by 0x170E56: multi_do (multi.c:1380)
==2932677== by 0x171E8A: multi_runsingle (multi.c:1854)
==2932677== by 0x172FEE: curl_multi_perform (multi.c:2363)