mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 14:29:54 +02:00
slcanpty: declare command buffer static
ASCII command buffer char buf[200] must be declared as static, because it holds incomplete commands between pty2can() calls. Without static it is not guaranteed, that buf retains the same data between calls. Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
This commit is contained in:
committed by
Marc Kleine-Budde
parent
31936b5a17
commit
c7aa0b7051
+1
-1
@@ -68,7 +68,7 @@ int pty2can(int pty, int socket, struct can_filter *fi,
|
|||||||
{
|
{
|
||||||
int nbytes;
|
int nbytes;
|
||||||
char cmd;
|
char cmd;
|
||||||
char buf[200];
|
static char buf[200];
|
||||||
char replybuf[10]; /* for answers to received commands */
|
char replybuf[10]; /* for answers to received commands */
|
||||||
int ptr;
|
int ptr;
|
||||||
struct can_frame frame;
|
struct can_frame frame;
|
||||||
|
|||||||
Reference in New Issue
Block a user