]> rtime.felk.cvut.cz Git - linux-lin.git/commitdiff
sllin: Fixed potential invalid pointer dereference.
authorRostislav Lisovy <lisovy@gmail.com>
Thu, 16 Feb 2012 15:14:53 +0000 (16:14 +0100)
committerRostislav Lisovy <lisovy@gmail.com>
Thu, 16 Feb 2012 15:14:53 +0000 (16:14 +0100)
sllin/sllin.c

index 4f4da0f143ea9f79eb5aa4ef13c1663223eb6e90..601979a2213232c5beae2081126b2ef17ca3b591 100644 (file)
@@ -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;
                                }