[llvm-commits] [PATCH] Use-after-free in ParseCommandLineOptions()

Frits van Bommel fvbommel at gmail.com
Thu Nov 18 11:05:53 PST 2010


Near the end of ParseCommandLineOptions()
(lib/Support/CommandLine.cpp) there's some debug code that prints out
the command line if -debug was specified. Unfortunately, if the
ReadResponseFiles parameter is true the expanded command line is
stored in memory which has just been free()d a few lines earlier.

This patch moves the debug code before the cleanup code, but after all
options (most importantly -debug) have been parsed and adds a comment
explaining why it's there.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: commandline-use-after-free.patch
Type: text/x-patch
Size: 1014 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101118/e28e5023/attachment.bin>


More information about the llvm-commits mailing list