[all-commits] [llvm/llvm-project] 28e312: [libc][obvious] fix printf failing to stop on %\0

michaelrj-google via All-commits all-commits at lists.llvm.org
Mon Nov 7 10:44:43 PST 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 28e312cbf098c05af9a1865805274cf7ab470dfd
      https://github.com/llvm/llvm-project/commit/28e312cbf098c05af9a1865805274cf7ab470dfd
  Author: Michael Jones <michaelrj at google.com>
  Date:   2022-11-07 (Mon, 07 Nov 2022)

  Changed paths:
    M libc/src/stdio/printf_core/parser.cpp
    M libc/src/stdio/scanf_core/parser.cpp
    M libc/test/src/stdio/printf_core/parser_test.cpp
    M libc/test/src/stdio/scanf_core/parser_test.cpp

  Log Message:
  -----------
  [libc][obvious] fix printf failing to stop on %\0

Previously, the printf parser would treat "%\0" as a conversion with the
name "\0", and advance past the null byte causing a buffer overflow.
This patch corrects that in both printf and scanf.

Reviewed By: sivachandra

Differential Revision: https://reviews.llvm.org/D137367




More information about the All-commits mailing list