[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Error in termios.c



Hello,

we have detected an error in the termios.c code. in the function 
rtems_termios_open() is memory allocated for various buffers and in the 
case that not enough memory is available totally released before exiting.

the following code is from termios.c Rev. 1.38 and also included in 
Rev.1.39 from SS20030128:
        /*
         * allocate raw output buffer
         */
        tty->rawOutBuf.Size = RAW_OUTPUT_BUFFER_SIZE;
        tty->rawOutBuf.theBuf = malloc (tty->rawOutBuf.Size);
=>      if (tty->rawInBuf.theBuf == NULL) {
            free((void *)(tty->rawInBuf.theBuf));
            free(tty);
            rtems_semaphore_release (rtems_termios_ttyMutex);
            return RTEMS_NO_MEMORY;
                 ... 
Not for the rawInBuf.theBuf == NULL should be checked, instead for the 
rawOutBuf.theBuf.

-- 
Sch?ne Gr??e aus Reutlingen

Wolfram Wadepohl
Entwicklung

--
INDUMAT GmbH & Co. KG
Transport- und Lagersysteme
Dieselstra?e 6
D-72770 Reutlingen - Betzingen

Tel.  +49 (0)71 21/5 14-2 89
Fax   +49 (0)71 21/5 14-2 99
eMail W.Wadepohl at indumat.de
WWW   http://www.indumat.de
--

Bitte senden Sie mir keine Word- oder PowerPoint- (tm Microsoft)  Anh?nge.
Senden Sie mir einfachen Text, HTML oder PDF. 
Siehe http://www.fsf.org/philosophy/no-word-attachments.de.html