ACK: [PATCH] lib: fwts_pipeio: fix incorrect size of command being passed
ivanhu
ivan.hu at canonical.com
Fri Apr 21 02:23:58 UTC 2017
On 04/13/2017 05:42 PM, 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: Ivan Hu <ivan.hu at canonical.com>
More information about the fwts-devel
mailing list