Scripts that I used to write a blog post about section 7.24.1(2) of C11
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md
bind-9.9.5.build.sh
bind-9.9.5.tar.gz.sum
boringssl-snapshot.build.sh
boringssl-snapshot.tar.gz
boringssl-snapshot.tar.gz.sum
canary.build.sh
canary.tar.gz
canary.tar.gz.sum
openssh-5.4p1.build.sh
openssh-5.4p1.tar.gz.sum
openssh-7.2p2.build.sh
openssh-7.2p2.tar.gz.sum
openssl-1.0.2h.build.sh
openssl-1.0.2h.tar.gz.sum
string.h.patch
test-changes.sh

README.md

Testing the effects of section 7.24.1(2) of the C11 standard

This repository contains the scripts that I used to write a blog post about the assumption, in the C standard, that all pointers passed to standard library functions are non-NULL. It compiles a number of packages with and without this assumption and writes their disassembly to a text file.

If you wish to reproduce you need to do some setup because test-changes.sh assumes that /usr/include/string.h.orig contains a pristine copy of /usr/include/string.h (with nonnull annotations) and that /usr/include/string.h.nullok contains a version of the same header but with the annotations removed. See string.h.patch for a diff from my computer of these files.

Once that's setup, you should ensure that you have passwordless sudo enabled, or else you'll be prompted for your password a few times. Otherwise, just running test-changes.sh should produce a number of disas files in subdirectories of nonnull and nullok. (Note that it'll take a while to build all the packages. If you're only interested in a subset, comment out the others in the .sh file.)