From: Rostislav Lisovy Date: Thu, 16 Feb 2012 15:14:53 +0000 (+0100) Subject: sllin: Fixed potential invalid pointer dereference. X-Git-Url: http://rtime.felk.cvut.cz/gitweb/linux-lin.git/commitdiff_plain/1098d3c4c045a6a1919b209476d27a07b2f13fce sllin: Fixed potential invalid pointer dereference. --- diff --git a/sllin/sllin.c b/sllin/sllin.c index 4f4da0f..601979a 100644 --- a/sllin/sllin.c +++ b/sllin/sllin.c @@ -524,13 +524,11 @@ static void sllin_slave_receive_buf(struct tty_struct *tty, /* We did not receive break (0x00) character */ if ((sl->rx_cnt == SLLIN_BUFF_BREAK) && (*cp == 0x55)) { sl->rx_buff[sl->rx_cnt++] = 0x00; - sl->rx_buff[sl->rx_cnt++] = 0x55; - cp++; } if (sl->rx_cnt == SLLIN_BUFF_SYNC) { /* 'Duplicated' break character -- ignore */ - if ((*cp == 0x00) && (*(cp + 1) == 0x55)) { + if (*cp == 0x00) { cp++; continue; }