Re: [PATCH] Fixed non-literal format in printf-style calls

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Daniel Lowe wrote:

<snip>

>  }
> diff --git a/grep.c b/grep.c
> index e2c190a..1db60d9 100644
> --- a/grep.c
> +++ b/grep.c
> @@ -514,7 +514,7 @@ static int grep_buffer_1(struct grep_opt *opt, const char *name,
>  				if (from <= last_shown)
>  					from = last_shown + 1;
>  				if (last_shown && from != last_shown + 1)
> -					printf(hunk_mark);
> +					printf("%s", hunk_mark);

Perhaps these should by changed to use fputs() instead.

<snip>

> diff --git a/path.c b/path.c
> index eb24017..ae2c724 100644
> --- a/path.c
> +++ b/path.c
> @@ -41,7 +41,7 @@ char *mksnpath(char *buf, size_t n, const char *fmt, ...)
>  	len = vsnprintf(buf, n, fmt, args);
>  	va_end(args);
>  	if (len >= n) {
> -		snprintf(buf, n, bad_path);
> +		snprintf(buf, n, "%s", bad_path);

and these should use strlcpy.

-brandon
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux