ACK: [PATCH] lib: fwts_pipeio: fix incorrect size of command being passed
Alex Hung
alex.hung at canonical.com
Mon Apr 17 17:14:56 UTC 2017
On 2017-04-13 02:42 AM, Colin King wrote:
> From: Colin Ian King <colin.king at canonical.com>
>
> Using sizeof(command) is clearly incorrect, we should be passing
> the length of the command instead of the size of the pointer.
>
> Detected with static analysis.
>
> Signed-off-by: Colin Ian King <colin.king at canonical.com>
> ---
> src/lib/src/fwts_pipeio.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lib/src/fwts_pipeio.c b/src/lib/src/fwts_pipeio.c
> index a2c941f4..fd719640 100644
> --- a/src/lib/src/fwts_pipeio.c
> +++ b/src/lib/src/fwts_pipeio.c
> @@ -342,7 +342,7 @@ int fwts_exec2(const char *command, char **output)
> }
>
> if (fwts_pipe_readwrite(in_fd,
> - command, sizeof(command),
> + command, strlen(command),
> out_fd, output, &out_len)) {
> return -1;
> }
>
Acked-by: Alex Hung <alex.hung at canonical.com>
More information about the fwts-devel
mailing list