Changeset a27128c5 in rtems


Ignore:
Timestamp:
02/24/17 09:29:05 (7 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
4.11
Children:
2ea436a
Parents:
0e8d2055
git-author:
Sebastian Huber <sebastian.huber@…> (02/24/17 09:29:05)
git-committer:
Sebastian Huber <sebastian.huber@…> (02/28/17 08:55:58)
Message:

termios: Fix infinite loop in receive path

In canonical mode, the raw input buffer or the canonical buffer may
overflow without an end of line. Avoid an infinite loop in this case.

Update #2915.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/libcsupport/src/termios.c

    r0e8d2055 ra27128c5  
    15221522     * Wait for characters
    15231523     */
    1524     if ( wait ) {
    1525       rtems_status_code sc;
    1526 
    1527       sc = rtems_semaphore_obtain(
    1528         tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
    1529       if (sc != RTEMS_SUCCESSFUL)
     1524    if (wait) {
     1525      if (tty->ccount < CBUFSIZE - 1) {
     1526        rtems_status_code sc;
     1527
     1528        sc = rtems_semaphore_obtain(
     1529          tty->rawInBuf.Semaphore, tty->rawInBufSemaphoreOptions, timeout);
     1530        if (sc != RTEMS_SUCCESSFUL)
     1531          break;
     1532      } else {
    15301533        break;
     1534      }
    15311535    }
    15321536  }
Note: See TracChangeset for help on using the changeset viewer.