All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] snprintf truncation fixes
@ 2018-05-19  1:54 Jeff King
  2018-05-19  1:56 ` [PATCH 1/5] http: use strbufs instead of fixed buffers Jeff King
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Jeff King @ 2018-05-19  1:54 UTC (permalink / raw)
  To: git

I happened today to be looking at a piece of code that used a bare
snprintf() without checking for truncation, and I got annoyed enough to
root out the last few cases in our codebase. After this series, looking
over the results of:

  git grep '[^vxn]snprintf' '*.c' :^compat

is pretty pleasant.

This series also gets rid of some uses of PATH_MAX, which is another pet
peeve of mine. :)

  [1/5]: http: use strbufs instead of fixed buffers
  [2/5]: log_write_email_headers: use strbufs
  [3/5]: query_fsmonitor: use xsnprintf for formatting integers
  [4/5]: shorten_unambiguous_ref: use xsnprintf
  [5/5]: fmt_with_err: add a comment that truncation is OK

 fsmonitor.c |  4 ++--
 http.c      | 66 +++++++++++++++++++++++++++++------------------------
 http.h      |  4 ++--
 log-tree.c  | 16 ++++++++-----
 refs.c      |  4 ++--
 usage.c     |  1 +
 6 files changed, 53 insertions(+), 42 deletions(-)

-Peff

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2018-05-21 20:57 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-19  1:54 [PATCH 0/5] snprintf truncation fixes Jeff King
2018-05-19  1:56 ` [PATCH 1/5] http: use strbufs instead of fixed buffers Jeff King
2018-05-21 18:11   ` Stefan Beller
2018-05-21 19:41     ` Jeff King
2018-05-21 20:57       ` Stefan Beller
2018-05-19  1:57 ` [PATCH 2/5] log_write_email_headers: use strbufs Jeff King
2018-05-19  1:57 ` [PATCH 3/5] query_fsmonitor: use xsnprintf for formatting integers Jeff King
2018-05-19  8:27   ` René Scharfe
2018-05-20 17:08     ` Jeff King
2018-05-21  0:58     ` Junio C Hamano
2018-05-21 12:36     ` Ben Peart
2018-05-19  1:58 ` [PATCH 4/5] shorten_unambiguous_ref: use xsnprintf Jeff King
2018-05-19  1:58 ` [PATCH 5/5] fmt_with_err: add a comment that truncation is OK Jeff King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.