TitleA type system for format strings
Publication TypeConference Paper
Year of Publication2014
AuthorsWeitz K, Kim G, Srisakaokul S, Ernst MD
Conference NameISSTA 2014, Proceedings of the 2014 International Symposium on Software Testing and Analysis
Pagination127–137
Date or Month PublishedJuly
Conference LocationSan Jose, CA, USA
AbstractMost programming languages support format strings, but their use is error-prone. Using the wrong format string syntax, or passing the wrong number or type of arguments, leads to unintelligible text output, program crashes, or security vulnerabilities. \par This paper presents a type system that guarantees that calls to format string APIs will never fail. In Java, this means that the API will not throw exceptions. In C, this means that the API will not return negative values, corrupt memory, etc. \par We instantiated this type system for Java's Formatter API, and evaluated it on 6 large and well-maintained open-source projects. Format string bugs are common in practice (our type system found 104 bugs), and the annotation burden on the user of our type system is low (on average, for every bug found, only 1.0 annotations need to be written).
Downloadshttps://homes.cs.washington.edu/~mernst/pubs/format-string-issta2014-dem... demo paper (PDF) https://checkerframework.org/manual/#formatter-checker Format String Checker implementation https://homes.cs.washington.edu/~mernst/pubs/format-string-issta2014.pdf PDF https://homes.cs.washington.edu/~mernst/pubs/format-string-issta2014-sli... slides (PDF)
Citation KeyWeitzKSE2014