Skip to content

Instantly share code, notes, and snippets.

View jpegfuzz.patch
commit 0c783ec6a639401153d96de1f4bc6ec8117c409c
Author: Nico Weber <thakis@chromium.org>
Date: Sun Jul 19 19:49:54 2020 -0400
fix one ppm fuzzer issue and two jpeg issues, all harmless DoS
diff --git a/Libraries/LibGfx/JPGLoader.cpp b/Libraries/LibGfx/JPGLoader.cpp
index 57772534d..03f7b2822 100644
--- a/Libraries/LibGfx/JPGLoader.cpp
+++ b/Libraries/LibGfx/JPGLoader.cpp
View bmp fuzz.diff
commit c9d1d14e56d7ed3cb3d43053c06a86229dc9ca65
Author: Nico Weber <thakis@chromium.org>
Date: Sat Jul 18 22:35:01 2020 -0400
bmp loader does not validate data_offset, can use that for arbitrary read, with <canvas> can probably leak arbitrary user mem to js
diff --git a/Libraries/LibGfx/BMPLoader.cpp b/Libraries/LibGfx/BMPLoader.cpp
index a6c82ca15..91299749a 100644
--- a/Libraries/LibGfx/BMPLoader.cpp
+++ b/Libraries/LibGfx/BMPLoader.cpp
View binpref.py
import ctypes
import os
import sys
libSystem = ctypes.CDLL('libSystem.dylib')
# `typedef void *posix_spawnattr_t;` on darwin
attrp = ctypes.c_void_p()
e = libSystem.posix_spawnattr_init(ctypes.byref(attrp))
print('spawnattr init ret:', e)
View posix_spawn.py
# Works with py2 and py3
import ctypes
import os
import sys
libSystem = ctypes.CDLL('libSystem.dylib')
spawn = libSystem.posix_spawnp
spawn.restype = ctypes.c_int
spawn.argtypes = (
View foo.cmake
# cmake -P foo.cmake
include(FindPythonInterp)
#set(FOO_DIR "/Users/thakis/blah")
set(FOO_DIR "/Users/thakis/blah" CACHE STRING "wsdf")
function(configure_lit_site_cfg site_in site_out)
cmake_parse_arguments(ARG "" "" "MAIN_CONFIG;OUTPUT_MAPPING;PATHS" ${ARGN})
View namescopepiece-node.diff
diff --git a/llvm/include/llvm/Demangle/MicrosoftDemangle.h b/llvm/include/llvm/Demangle/MicrosoftDemangle.h
index c6f26061bed..96d015f2ded 100644
--- a/llvm/include/llvm/Demangle/MicrosoftDemangle.h
+++ b/llvm/include/llvm/Demangle/MicrosoftDemangle.h
@@ -202,7 +202,7 @@ private:
QualifiedNameNode *demangleNameScopeChain(StringView &MangledName,
IdentifierNode *UnqualifiedName);
- IdentifierNode *demangleNameScopePiece(StringView &MangledName);
+ Node *demangleNameScopePiece(StringView &MangledName);
@nico
nico / llvm-gn-swarming.patch
Last active May 18, 2020
demo for running check-clang on swarming (tested on mac only)
View llvm-gn-swarming.patch
Mostly superceded by https://github.com/nico/llvm-project/commit/c43875075d15a58e674792b45b0e96d721296aed
commit 02c27a95ecc0555ba30c363321cc62459e469bff
Author: Nico Weber <nicolasweber@gmx.de>
Date: Fri Jun 15 16:54:38 2018 -0400
demo for running check-clang on swarming (tested on mac only)
Use like so:
# Instant:
View lld-link-perf.txt
View lastkeyoled.py
import Adafruit_SSD1306
import struct
import sys
import termios
from PIL import Image
from PIL import ImageFont
from PIL import ImageDraw
# 128x64 display with hardware I2C:
disp = Adafruit_SSD1306.SSD1306_128_64(rst=24)
View gist:0ca75f5e0afd898ef78ef8d078ead7bb
C:\src\hack>type xmltest_in.xml
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="common.css"?>
<hi>
<hi xmlns="http://example.com/foo-ns" xmlns:x="urn:example-com:bar-ns">
<?foobar version="1.0"?>
<ho
/>text&amp;more@<x:ho x:attr="adsf"/>
<!-- adsf -->
</hi>
You can’t perform that action at this time.