[dovecot/core] 51292e: lib: Optimize printf_format_fix_noalloc()

GitHub noreply at github.com
Sun Dec 18 11:00:09 UTC 2016


  Branch: refs/heads/master
  Home:   https://github.com/dovecot/core
  Commit: 51292e327a91a257b8baea83560b3a8323cac8c5
      https://github.com/dovecot/core/commit/51292e327a91a257b8baea83560b3a8323cac8c5
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-18 (Sun, 18 Dec 2016)

  Changed paths:
    M src/lib/printf-format-fix.c

  Log Message:
  -----------
  lib: Optimize printf_format_fix_noalloc()

Using strchr() is faster than looping through the characters manually.
Since this function is being called a lot, it's worth optimizing.


  Commit: 4baf980b75800ad3595c39dc3b8d913f2686affd
      https://github.com/dovecot/core/commit/4baf980b75800ad3595c39dc3b8d913f2686affd
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-18 (Sun, 18 Dec 2016)

  Changed paths:
    M src/lib/printf-format-fix.c
    M src/lib/test-printf-format-fix.c

  Log Message:
  -----------
  lib: Fix %n detection in printf_format_fix_noalloc()

It's undefined how flags, precision or length modifiers are handled with %n,
so make sure we catch all of them to detect an unwanted %n.


  Commit: ebe00087d3c7f9706d4acb9017eaad912404516c
      https://github.com/dovecot/core/commit/ebe00087d3c7f9706d4acb9017eaad912404516c
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-18 (Sun, 18 Dec 2016)

  Changed paths:
    M src/lib/printf-format-fix.c

  Log Message:
  -----------
  lib: Allow only known %chars in printf_format_fix_noalloc()

Otherwise if some libc adds a new unsupported character, our %n check might
break.


  Commit: b48648a49c41b18dd8ea8761e48e4c64e105adec
      https://github.com/dovecot/core/commit/b48648a49c41b18dd8ea8761e48e4c64e105adec
  Author: Timo Sirainen <timo.sirainen at dovecot.fi>
  Date:   2016-12-18 (Sun, 18 Dec 2016)

  Changed paths:
    M src/lib/test-malloc-overflow.c

  Log Message:
  -----------
  lib: Remove dead code from unit test


Compare: https://github.com/dovecot/core/compare/458479447743...b48648a49c41


More information about the dovecot-cvs mailing list