[libc] Prevent printf index mode crashes
The posix standard defines an alternate mode for printf where the conversions also have an index that describes which argument to select. Due to how variadic arguments work in C, to reach the nth argument all n-1 previous arguments must be read with their correct types. If the format string does not specify the types for a continuous set of arguments, then the arguments after the discontinuity cannot be safely read. This patch causes all conversions requesting an argument that comes after a gap be treated as raw (i.e. the conversion string is printed literally). Reviewed By: sivachandra Differential Revision: https://reviews.llvm.org/D143782
parent
40d772c6
Please register or sign in to comment