From: Dmitry V. Levin Date: Sat, 6 Jan 2018 01:45:16 +0000 (+0000) Subject: open.c: use xsnprintf instead of sprintf X-Git-Tag: v4.21~201 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b75f886706e92d51db63b86299a7069a08bda269;p=strace open.c: use xsnprintf instead of sprintf * open.c: Include "xstring.h". (sprint_open_modes): Replace sprintf with xsnprintf. --- diff --git a/open.c b/open.c index 28222666..ab9e8ef7 100644 --- a/open.c +++ b/open.c @@ -34,6 +34,7 @@ */ #include "defs.h" +#include "xstring.h" #include @@ -110,7 +111,7 @@ sprint_open_modes(unsigned int flags) } /* flags is still nonzero */ *p++ = sep; - sprintf(p, "%#x", flags); + xsnprintf(p, sizeof(outstr) - (p - outstr), "%#x", flags); return outstr; }