Index: packages/devs/serial/arm/aaed2000/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/aaed2000/current/ChangeLog,v
retrieving revision 1.3
diff -u -w -r1.3 ChangeLog
--- packages/devs/serial/arm/aaed2000/current/ChangeLog	24 Feb 2003 14:11:43 -0000	1.3
+++ packages/devs/serial/arm/aaed2000/current/ChangeLog	25 Jun 2007 10:32:11 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/aaed2000_serial.c (aaed2000_serial_config_port): Added
+	baud rate range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_arm_aaed2000.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/arm/aaed2000/current/src/aaed2000_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/aaed2000/current/src/aaed2000_serial.c,v
retrieving revision 1.2
diff -u -w -r1.2 aaed2000_serial.c
--- packages/devs/serial/arm/aaed2000/current/src/aaed2000_serial.c	23 May 2002 23:01:08 -0000	1.2
+++ packages/devs/serial/arm/aaed2000/current/src/aaed2000_serial.c	25 Jun 2007 12:35:44 -0000
@@ -138,8 +138,13 @@
 {
     aaed2000_serial_info *aaed2000_chan = (aaed2000_serial_info *)chan->dev_priv;
     CYG_ADDRWORD base = aaed2000_chan->base;
-    unsigned short baud_divisor = select_baud[new_config->baud];
+    unsigned short baud_divisor;
     cyg_uint32 _lcr, _intm;
+
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0) return false;
 
     // Register writes don't take effect till the UART is enabled.
Index: packages/devs/serial/arm/aeb/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/aeb/current/ChangeLog,v
retrieving revision 1.9
diff -u -w -r1.9 ChangeLog
--- packages/devs/serial/arm/aeb/current/ChangeLog	24 Feb 2003 14:12:00 -0000	1.9
+++ packages/devs/serial/arm/aeb/current/ChangeLog	25 Jun 2007 10:32:55 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/aeb_serial.c (aeb_serial_config_port): Added baud rate range
+	validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_arm_aeb.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/arm/aeb/current/src/aeb_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/aeb/current/src/aeb_serial.c,v
retrieving revision 1.4
diff -u -w -r1.4 aeb_serial.c
--- packages/devs/serial/arm/aeb/current/src/aeb_serial.c	23 May 2002 23:01:08 -0000	1.4
+++ packages/devs/serial/arm/aeb/current/src/aeb_serial.c	25 Jun 2007 12:35:48 -0000
@@ -179,8 +179,13 @@
 {
     aeb_serial_info *aeb_chan = (aeb_serial_info *)chan->dev_priv;
     volatile struct serial_port *port = (volatile struct serial_port *)aeb_chan->base;
-    unsigned short baud_divisor = select_baud[new_config->baud];
+    unsigned short baud_divisor;
     unsigned char _lcr, _ier;
+
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0) return false;
     _ier = port->REG_IER;
     port->REG_IER = 0;  // Disable port interrupts while changing hardware
Index: packages/devs/serial/arm/at91/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/at91/current/ChangeLog,v
retrieving revision 1.16
diff -u -w -r1.16 ChangeLog
--- packages/devs/serial/arm/at91/current/ChangeLog	2 Jun 2007 17:20:02 -0000	1.16
+++ packages/devs/serial/arm/at91/current/ChangeLog	25 Jun 2007 10:33:36 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/at91_serial.c (at91_serial_config_port): Added baud rate range
+	validation code.
+
 2007-06-01  Jim Seymour <jim@cipher.com>
 
 	* src/at91_serial.c (at91_serial_DSR): Remove CYG_FAIL if receive
Index: packages/devs/serial/arm/at91/current/src/at91_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/at91/current/src/at91_serial.c,v
retrieving revision 1.14
diff -u -w -r1.14 at91_serial.c
--- packages/devs/serial/arm/at91/current/src/at91_serial.c	2 Jun 2007 17:20:03 -0000	1.14
+++ packages/devs/serial/arm/at91/current/src/at91_serial.c	25 Jun 2007 12:35:52 -0000
@@ -294,6 +294,10 @@
     cyg_uint32 word_length = select_word_length[new_config->word_length-CYGNUM_SERIAL_WORD_LENGTH_5];
     cyg_uint32 stop_bits = select_stop_bits[new_config->stop];
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+
     if ((word_length == 0xFF) ||
         (parity == 0xFF) ||
         (stop_bits == 0xFF)) {
Index: packages/devs/serial/arm/cma230/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/cma230/current/ChangeLog,v
retrieving revision 1.8
diff -u -w -r1.8 ChangeLog
--- packages/devs/serial/arm/cma230/current/ChangeLog	24 Feb 2003 14:12:53 -0000	1.8
+++ packages/devs/serial/arm/cma230/current/ChangeLog	25 Jun 2007 10:34:32 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/cma230_serial.c (cma230_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_arm_cma230.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/arm/cma230/current/src/cma230_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/cma230/current/src/cma230_serial.c,v
retrieving revision 1.5
diff -u -w -r1.5 cma230_serial.c
--- packages/devs/serial/arm/cma230/current/src/cma230_serial.c	23 May 2002 23:01:10 -0000	1.5
+++ packages/devs/serial/arm/cma230/current/src/cma230_serial.c	25 Jun 2007 12:35:56 -0000
@@ -179,8 +179,13 @@
 {
     cma230_serial_info *cma230_chan = (cma230_serial_info *)chan->dev_priv;
     volatile struct serial_port *port = (volatile struct serial_port *)cma230_chan->base;
-    unsigned short baud_divisor = select_baud[new_config->baud];
+    unsigned short baud_divisor;
     unsigned char _lcr, _ier;
+
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0) return false;  // Invalid configuration
     _ier = port->ier;
     port->ier = 0;  // Disable port interrupts while changing hardware
Index: packages/devs/serial/arm/e7t/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/e7t/current/ChangeLog,v
retrieving revision 1.5
diff -u -w -r1.5 ChangeLog
--- packages/devs/serial/arm/e7t/current/ChangeLog	16 Feb 2004 16:12:50 -0000	1.5
+++ packages/devs/serial/arm/e7t/current/ChangeLog	25 Jun 2007 10:35:16 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/e7t_serial.c (e7t_serial_config_port): Added baud rate
+	range validation code.
+
 2004-02-11  Roland Caßebohm  <roland.cassebohm@visionsystem.de>
 
 	* src/e7t_serial.c: The UART doesn't generate an interrupt befor the
Index: packages/devs/serial/arm/e7t/current/src/e7t_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/e7t/current/src/e7t_serial.c,v
retrieving revision 1.4
diff -u -w -r1.4 e7t_serial.c
--- packages/devs/serial/arm/e7t/current/src/e7t_serial.c	16 Feb 2004 16:12:50 -0000	1.4
+++ packages/devs/serial/arm/e7t/current/src/e7t_serial.c	25 Jun 2007 12:36:02 -0000
@@ -191,17 +191,23 @@
   cyg_uint32 word_length = select_word_length[(new_config->word_length)-CYGNUM_SERIAL_WORD_LENGTH_5];
   cyg_uint32 stop_bits = select_stop_bits[(new_config->stop)-CYGNUM_SERIAL_STOP_1];
   cyg_uint32 parity_mode = select_parity[(new_config->parity)-CYGNUM_SERIAL_PARITY_NONE];
-  cyg_uint32 baud_divisor = select_baud[(new_config->baud)-CYGNUM_SERIAL_BAUD_50];
+  cyg_uint32 baud_divisor;
   cyg_uint32 res = word_length | stop_bits | parity_mode | ULCON_SCI | ULCON_IROFF;
+
+  if ((sizeof(select_baud)/sizeof(select_baud[0])) <=
+      (new_config->baud-CYGNUM_SERIAL_BAUD_50)) {
+      return false;
+  }
+  baud_divisor = select_baud[(new_config->baud)-CYGNUM_SERIAL_BAUD_50];
   if ((word_length|stop_bits|parity_mode|baud_divisor) == U_NOT_SUPP) {
     return false;
-  };
+  }
   port->REG_ULCON = res;
   port->REG_UCON = UCON_RXMINT | UCON_RXSIOFF | UCON_TXMINT | UCON_DSROFF | UCON_SBKOFF | UCON_LPBOFF;
   port->REG_UBRDIV = baud_divisor;
   if (new_config != &chan->config) {
     chan->config = *new_config;
-  };
+  }
   return true;
 }
 
Index: packages/devs/serial/arm/ebsa285/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/ebsa285/current/ChangeLog,v
retrieving revision 1.8
diff -u -w -r1.8 ChangeLog
--- packages/devs/serial/arm/ebsa285/current/ChangeLog	24 Feb 2003 14:13:30 -0000	1.8
+++ packages/devs/serial/arm/ebsa285/current/ChangeLog	25 Jun 2007 10:36:29 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/ebsa285_serial.c (ebsa285_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_arm_ebsa285.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/arm/ebsa285/current/src/ebsa285_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/ebsa285/current/src/ebsa285_serial.c,v
retrieving revision 1.4
diff -u -w -r1.4 ebsa285_serial.c
--- packages/devs/serial/arm/ebsa285/current/src/ebsa285_serial.c	23 May 2002 23:01:10 -0000	1.4
+++ packages/devs/serial/arm/ebsa285/current/src/ebsa285_serial.c	25 Jun 2007 12:36:06 -0000
@@ -246,6 +246,10 @@
     // are necessary to force the UART to update its register
     // contents.
 
+    if ((sizeof(bauds)/sizeof(bauds[0])) <= new_config->baud) {
+        l = m = h = 0;
+    }
+    else {
     l = bauds[new_config->baud].divisor_low;   // zeros in unused slots here
     m = bauds[new_config->baud].divisor_high;  // and here
     h = SA110_UART_BREAK_DISABLED    |      
@@ -253,6 +257,7 @@
         select_parity[new_config->parity]  |   // and these
         SA110_UART_FIFO_ENABLED |              // and these below
         select_word_length[new_config->word_length - CYGNUM_SERIAL_WORD_LENGTH_5];
+    }
 
     if ( 0 != (l + m) && h >= 0 && h < 256 ) {
         *SA110_UART_L_BAUD_CONTROL = l;
Index: packages/devs/serial/arm/edb7xxx/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/edb7xxx/current/ChangeLog,v
retrieving revision 1.9
diff -u -w -r1.9 ChangeLog
--- packages/devs/serial/arm/edb7xxx/current/ChangeLog	24 Feb 2003 14:13:45 -0000	1.9
+++ packages/devs/serial/arm/edb7xxx/current/ChangeLog	25 Jun 2007 10:36:58 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/edb7xxx_serial.c (edb7xxx_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_arm_edb7xxx.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/arm/edb7xxx/current/src/edb7xxx_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/edb7xxx/current/src/edb7xxx_serial.c,v
retrieving revision 1.4
diff -u -w -r1.4 edb7xxx_serial.c
--- packages/devs/serial/arm/edb7xxx/current/src/edb7xxx_serial.c	23 May 2002 23:01:11 -0000	1.4
+++ packages/devs/serial/arm/edb7xxx/current/src/edb7xxx_serial.c	25 Jun 2007 12:36:10 -0000
@@ -203,8 +203,13 @@
     edb7xxx_serial_info *edb7xxx_chan = (edb7xxx_serial_info *)chan->dev_priv;
     volatile cyg_uint32 *syscon = (volatile cyg_uint32 *)edb7xxx_chan->syscon;
     volatile cyg_uint32 *blcfg = (volatile cyg_uint32 *)edb7xxx_chan->control;
-    unsigned int baud_divisor = select_baud[new_config->baud];
+    unsigned int baud_divisor;
     cyg_uint32 _lcr;
+
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0) return false;
     // Disable port interrupts while changing hardware
     _lcr = select_word_length[new_config->word_length - CYGNUM_SERIAL_WORD_LENGTH_5] | 
Index: packages/devs/serial/arm/gps4020/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/gps4020/current/ChangeLog,v
retrieving revision 1.1
diff -u -w -r1.1 ChangeLog
--- packages/devs/serial/arm/gps4020/current/ChangeLog	24 Nov 2003 15:24:16 -0000	1.1
+++ packages/devs/serial/arm/gps4020/current/ChangeLog	25 Jun 2007 10:37:30 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/gps4020_serial.c (gps4020_serial_config_port): Added baud rate
+	range validation code.
+
 2003-11-10  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/gps4020_serial.c: 
Index: packages/devs/serial/arm/gps4020/current/src/gps4020_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/gps4020/current/src/gps4020_serial.c,v
retrieving revision 1.1
diff -u -w -r1.1 gps4020_serial.c
--- packages/devs/serial/arm/gps4020/current/src/gps4020_serial.c	24 Nov 2003 15:24:16 -0000	1.1
+++ packages/devs/serial/arm/gps4020/current/src/gps4020_serial.c	25 Jun 2007 12:36:13 -0000
@@ -248,13 +248,17 @@
 {
     gps4020_serial_info *gps4020_chan = (gps4020_serial_info *)chan->dev_priv;
     volatile struct _gps4020_uart *regs = (volatile struct _gps4020_uart *)gps4020_chan->regs;
-    unsigned int baud_divisor = select_baud[new_config->baud];
+    unsigned int baud_divisor;
     short word_len = select_word_length[new_config->word_length - CYGNUM_SERIAL_WORD_LENGTH_5];
     short stop_bits = select_stop_bits[new_config->stop];
     short parity =   select_parity[new_config->parity];
     short mode = word_len | stop_bits | parity;
     int prescale = 0;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (mode >= 0) {
         while (baud_divisor > 0xFF) {
             prescale++;
Index: packages/devs/serial/arm/integrator/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/integrator/current/ChangeLog,v
retrieving revision 1.5
diff -u -w -r1.5 ChangeLog
--- packages/devs/serial/arm/integrator/current/ChangeLog	18 Mar 2003 18:18:38 -0000	1.5
+++ packages/devs/serial/arm/integrator/current/ChangeLog	25 Jun 2007 10:38:12 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/integrator_serial_with_ints.c (integrator_serial_config_port):
+	Added baud rate range validation code.
+
 2003-03-18  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/integrator_serial_with_ints.c (integrator_serial_set_config): 
Index: packages/devs/serial/arm/integrator/current/src/integrator_serial_with_ints.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/integrator/current/src/integrator_serial_with_ints.c,v
retrieving revision 1.4
diff -u -w -r1.4 integrator_serial_with_ints.c
--- packages/devs/serial/arm/integrator/current/src/integrator_serial_with_ints.c	18 Mar 2003 18:18:38 -0000	1.4
+++ packages/devs/serial/arm/integrator/current/src/integrator_serial_with_ints.c	25 Jun 2007 12:36:17 -0000
@@ -191,10 +191,14 @@
 {
     integrator_serial_info *integrator_chan = (integrator_serial_info *)chan->dev_priv;
     unsigned int port = (unsigned int)integrator_chan->base;
-    unsigned short baud_divisor = select_baud[new_config->baud];
+    unsigned short baud_divisor;
     unsigned char _lcr ;
 
     // don't do this baud rate...
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0) return false;  // Invalid configuration
 
     // first, disable everything 
Index: packages/devs/serial/arm/lpc2xxx/current/include/arm_lpc2xxx_ser.inl
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/lpc2xxx/current/include/arm_lpc2xxx_ser.inl,v
retrieving revision 1.2
diff -u -w -r1.2 arm_lpc2xxx_ser.inl
--- packages/devs/serial/arm/lpc2xxx/current/include/arm_lpc2xxx_ser.inl	15 Nov 2004 09:20:27 -0000	1.2
+++ packages/devs/serial/arm/lpc2xxx/current/include/arm_lpc2xxx_ser.inl	25 Jun 2007 12:02:40 -0000
@@ -75,7 +75,9 @@
     38400,
     57600,
     115200,
-    230400
+    230400,
+    460800,
+    921600
 };
 
 // we need dynamically generated divider values because they depend on the 
Index: packages/devs/serial/arm/s3c4510/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/s3c4510/current/ChangeLog,v
retrieving revision 1.1
diff -u -w -r1.1 ChangeLog
--- packages/devs/serial/arm/s3c4510/current/ChangeLog	14 May 2004 14:53:37 -0000	1.1
+++ packages/devs/serial/arm/s3c4510/current/ChangeLog	25 Jun 2007 11:15:01 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/s3c4510_serial.c (s3c4510_serial_config_port): Added baud rate
+	range validation code.
+
 2004-02-11  Roland Caßebohm  <roland.cassebohm@visionsystem.de>

 

         * src/s3c4510_serial.c: The UART doesn't generate an interrupt

Index: packages/devs/serial/arm/s3c4510/current/src/s3c4510_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/s3c4510/current/src/s3c4510_serial.c,v
retrieving revision 1.1
diff -u -w -r1.1 s3c4510_serial.c
--- packages/devs/serial/arm/s3c4510/current/src/s3c4510_serial.c	14 May 2004 14:53:37 -0000	1.1
+++ packages/devs/serial/arm/s3c4510/current/src/s3c4510_serial.c	25 Jun 2007 12:36:23 -0000
@@ -111,17 +111,23 @@
   cyg_uint32 word_length = select_word_length[(new_config->word_length)-CYGNUM_SERIAL_WORD_LENGTH_5];
   cyg_uint32 stop_bits = select_stop_bits[(new_config->stop)-CYGNUM_SERIAL_STOP_1];
   cyg_uint32 parity_mode = select_parity[(new_config->parity)-CYGNUM_SERIAL_PARITY_NONE];
-  cyg_uint32 baud_divisor = select_baud[(new_config->baud)-CYGNUM_SERIAL_BAUD_50];
+  cyg_uint32 baud_divisor;
   cyg_uint32 res = word_length | stop_bits | parity_mode | ULCON_SCI | ULCON_IROFF;
+
+  if ((sizeof(select_baud)/sizeof(select_baud[0])) <=
+      ((new_config->baud)-CYGNUM_SERIAL_BAUD_50)) {
+      return false;
+  }
+  baud_divisor = select_baud[(new_config->baud)-CYGNUM_SERIAL_BAUD_50];
   if ((word_length|stop_bits|parity_mode|baud_divisor) == U_NOT_SUPP) {
     return false;
-  };
+  }
   port->REG_ULCON = res;
   port->REG_UCON = UCON_RXMINT | UCON_RXSIOFF | UCON_TXMINT | UCON_DSROFF | UCON_SBKOFF | UCON_LPBOFF;
   port->REG_UBRDIV = baud_divisor;
   if (new_config != &chan->config) {
     chan->config = *new_config;
-  };
+  }
   return true;
 }
 
Index: packages/devs/serial/arm/sa11x0/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/sa11x0/current/ChangeLog,v
retrieving revision 1.8
diff -u -w -r1.8 ChangeLog
--- packages/devs/serial/arm/sa11x0/current/ChangeLog	24 Feb 2003 14:15:02 -0000	1.8
+++ packages/devs/serial/arm/sa11x0/current/ChangeLog	25 Jun 2007 10:40:31 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/sa11x0_serial.c (sa11x0_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_arm_sa11x0.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/arm/sa11x0/current/src/sa11x0_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/sa11x0/current/src/sa11x0_serial.c,v
retrieving revision 1.5
diff -u -w -r1.5 sa11x0_serial.c
--- packages/devs/serial/arm/sa11x0/current/src/sa11x0_serial.c	23 May 2002 23:01:19 -0000	1.5
+++ packages/devs/serial/arm/sa11x0/current/src/sa11x0_serial.c	25 Jun 2007 12:36:27 -0000
@@ -183,7 +183,12 @@
     unsigned char parity = select_parity[new_config->parity];
     unsigned char word_length = select_word_length[new_config->word_length-CYGNUM_SERIAL_WORD_LENGTH_5];
     unsigned char stop_bits = select_stop_bits[new_config->stop];
-    int baud = SA11X0_UART_BAUD_RATE_DIVISOR(select_baud[new_config->baud]);
+    int baud;
+
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud = SA11X0_UART_BAUD_RATE_DIVISOR(select_baud[new_config->baud]);
     if ((word_length == 0xFF) ||
         (parity == 0xFF) ||
         (stop_bits == 0xFF)) {
Index: packages/devs/serial/arm/smdk2410/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/smdk2410/current/ChangeLog,v
retrieving revision 1.1
diff -u -w -r1.1 ChangeLog
--- packages/devs/serial/arm/smdk2410/current/ChangeLog	6 Aug 2003 17:23:02 -0000	1.1
+++ packages/devs/serial/arm/smdk2410/current/ChangeLog	25 Jun 2007 10:41:09 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/smdk2410_serial.c (smdk2410_serial_config_port): Added baud rate
+	range validation code.
+
 2003-08-06  Michael Anburaj <embeddedeng@hotmail.com>
 
 	* cdl/ser_arm_smdk2410.cdl:
Index: packages/devs/serial/arm/smdk2410/current/src/smdk2410_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/arm/smdk2410/current/src/smdk2410_serial.c,v
retrieving revision 1.1
diff -u -w -r1.1 smdk2410_serial.c
--- packages/devs/serial/arm/smdk2410/current/src/smdk2410_serial.c	6 Aug 2003 17:23:03 -0000	1.1
+++ packages/devs/serial/arm/smdk2410/current/src/smdk2410_serial.c	25 Jun 2007 12:39:03 -0000
@@ -183,9 +183,12 @@
 {

     smdk2410_serial_info *smdk2410_chan = (smdk2410_serial_info *)chan->dev_priv;

     CYG_ADDRWORD base = smdk2410_chan->base;

-    unsigned short baud_divisor = select_baud[new_config->baud];

+    unsigned short baud_divisor;
     cyg_uint32 _lcr;

 

+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
     if (baud_divisor == 0) return false;

 

     if (init) {

Index: packages/devs/serial/coldfire/mcf5272/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/coldfire/mcf5272/current/ChangeLog,v
retrieving revision 1.1
diff -u -w -r1.1 ChangeLog
--- packages/devs/serial/coldfire/mcf5272/current/ChangeLog	9 May 2006 16:53:04 -0000	1.1
+++ packages/devs/serial/coldfire/mcf5272/current/ChangeLog	25 Jun 2007 10:42:15 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/mcf5272_serial.c (MCF5272_uart_config_port): Added baud rate
+	range validation code.
+
 2006-05-09  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* src/mcf5272_serial.c (MCF5272_uart_init): Fix compiler warning
Index: packages/devs/serial/coldfire/mcf5272/current/src/mcf5272_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/coldfire/mcf5272/current/src/mcf5272_serial.c,v
retrieving revision 1.1
diff -u -w -r1.1 mcf5272_serial.c
--- packages/devs/serial/coldfire/mcf5272/current/src/mcf5272_serial.c	9 May 2006 16:53:04 -0000	1.1
+++ packages/devs/serial/coldfire/mcf5272/current/src/mcf5272_serial.c	25 Jun 2007 12:39:34 -0000
@@ -458,6 +458,9 @@
     
     // Get the  divider  from  the  baudrate  table  which  will  use  to
     // configure the port's baud rate.
+    if ((sizeof(dividers_table)/sizeof(dividers_table[0]) <= new_config->baud) {
+        return false;
+    }
     ubgs = (cyg_uint16) dividers_table[new_config->baud];
 
     // Save the configuration value for later use
Index: packages/devs/serial/generic/16x5x/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/generic/16x5x/current/ChangeLog,v
retrieving revision 1.16
diff -u -w -r1.16 ChangeLog
--- packages/devs/serial/generic/16x5x/current/ChangeLog	22 Jun 2007 11:41:49 -0000	1.16
+++ packages/devs/serial/generic/16x5x/current/ChangeLog	25 Jun 2007 10:43:19 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/ser_16x5x.c (serial_config_port): Added baud rate range
+	validation code.
+
 2007-06-22  Alexander Aganichev  <aaganichev@gmail.com>
 
 	* cdl/ser_generic_16x5x.cdl
Index: packages/devs/serial/generic/16x5x/current/src/ser_16x5x.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/generic/16x5x/current/src/ser_16x5x.c,v
retrieving revision 1.15
diff -u -w -r1.15 ser_16x5x.c
--- packages/devs/serial/generic/16x5x/current/src/ser_16x5x.c	22 Jun 2007 11:41:49 -0000	1.15
+++ packages/devs/serial/generic/16x5x/current/src/ser_16x5x.c	25 Jun 2007 12:41:42 -0000
@@ -235,8 +235,13 @@
 {
     pc_serial_info *ser_chan = (pc_serial_info *)chan->dev_priv;
     cyg_addrword_t base = ser_chan->base;
-    unsigned short baud_divisor = select_baud[new_config->baud];
+    unsigned short baud_divisor;
     unsigned char _lcr, _ier;
+
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0) return false;  // Invalid configuration
 
     // Disable port interrupts while changing hardware
Index: packages/devs/serial/h8300/h8300h/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/h8300/h8300h/current/ChangeLog,v
retrieving revision 1.3
diff -u -w -r1.3 ChangeLog
--- packages/devs/serial/h8300/h8300h/current/ChangeLog	24 Feb 2003 14:15:34 -0000	1.3
+++ packages/devs/serial/h8300/h8300h/current/ChangeLog	25 Jun 2007 10:44:03 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/h8300_sci_serial.c (h8300_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/serial_h8300.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/h8300/h8300h/current/src/h8300_sci_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/h8300/h8300h/current/src/h8300_sci_serial.c,v
retrieving revision 1.2
diff -u -w -r1.2 h8300_sci_serial.c
--- packages/devs/serial/h8300/h8300h/current/src/h8300_sci_serial.c	23 May 2002 23:01:19 -0000	1.2
+++ packages/devs/serial/h8300/h8300h/current/src/h8300_sci_serial.c	25 Jun 2007 12:40:14 -0000
@@ -231,10 +231,15 @@
 h8300_serial_config_port(serial_channel *chan, cyg_serial_info_t *new_config, 
                       bool init)
 {
-    cyg_uint16 baud_divisor = select_baud[new_config->baud];
+    cyg_uint16 baud_divisor;
     h8300_sci_info *h8300_chan = (h8300_sci_info *)chan->dev_priv;
     cyg_uint8 _scr, _smr;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
+
     // Check configuration request
     if ((-1 == select_word_length[(new_config->word_length -
                                   CYGNUM_SERIAL_WORD_LENGTH_5)])
Index: packages/devs/serial/mcf52xx/mcf5272/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mcf52xx/mcf5272/current/ChangeLog,v
retrieving revision 1.1
diff -u -w -r1.1 ChangeLog
--- packages/devs/serial/mcf52xx/mcf5272/current/ChangeLog	24 Feb 2003 14:16:16 -0000	1.1
+++ packages/devs/serial/mcf52xx/mcf5272/current/ChangeLog	25 Jun 2007 10:45:21 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/ser_mcf5272_uart.c (MCF5272_uart_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_mcf5272_uart.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/mcf52xx/mcf5272/current/src/ser_mcf5272_uart.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mcf52xx/mcf5272/current/src/ser_mcf5272_uart.c,v
retrieving revision 1.1
diff -u -w -r1.1 ser_mcf5272_uart.c
--- packages/devs/serial/mcf52xx/mcf5272/current/src/ser_mcf5272_uart.c	29 May 2002 18:28:06 -0000	1.1
+++ packages/devs/serial/mcf52xx/mcf5272/current/src/ser_mcf5272_uart.c	25 Jun 2007 12:40:23 -0000
@@ -441,6 +441,10 @@
     /*   Get the  divisor  from  the  baudrate  table  which  will  use  to */
     /* configure the port's baud rate.                                      */
 
+    if ((sizeof(baud_rates_table)/sizeof(baud_rates_table[0]) <=
+        new_config->baud) {
+        return false;
+    }
     baud_divisor = baud_rates_table[new_config->baud];
 
     /*   If the divisor is zeor, we dont' configure the port.               */
Index: packages/devs/serial/mips/atlas/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/atlas/current/ChangeLog,v
retrieving revision 1.5
diff -u -w -r1.5 ChangeLog
--- packages/devs/serial/mips/atlas/current/ChangeLog	24 Feb 2003 14:16:35 -0000	1.5
+++ packages/devs/serial/mips/atlas/current/ChangeLog	25 Jun 2007 10:46:08 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/atlas_serial.c (atlas_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_mips_atlas.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/mips/atlas/current/src/atlas_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/atlas/current/src/atlas_serial.c,v
retrieving revision 1.3
diff -u -w -r1.3 atlas_serial.c
--- packages/devs/serial/mips/atlas/current/src/atlas_serial.c	23 May 2002 23:01:20 -0000	1.3
+++ packages/devs/serial/mips/atlas/current/src/atlas_serial.c	25 Jun 2007 12:40:29 -0000
@@ -147,9 +147,13 @@
 {
     atlas_serial_info *atlas_chan = (atlas_serial_info *)chan->dev_priv;
     cyg_addrword_t port = atlas_chan->base;
-    cyg_uint16 baud_divisor = select_baud[new_config->baud];
+    cyg_uint16 baud_divisor;
     cyg_uint8 _lcr, _ier;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0)
         return false;    // Invalid baud rate selected
 
Index: packages/devs/serial/mips/idt79s334a/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/idt79s334a/current/ChangeLog,v
retrieving revision 1.3
diff -u -w -r1.3 ChangeLog
--- packages/devs/serial/mips/idt79s334a/current/ChangeLog	29 Apr 2003 02:27:26 -0000	1.3
+++ packages/devs/serial/mips/idt79s334a/current/ChangeLog	25 Jun 2007 10:46:35 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/mipsidt_serial.c (mipsidt_serial_config_port): Added baud rate
+	range validation code.
+
 2003-03-09  Tim Michals  <t.michals@attbi.com>
 	
 	* cdl/ser_mipsidt_334a.cdl: Add configuration for second serial port.
Index: packages/devs/serial/mips/idt79s334a/current/src/mipsidt_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/idt79s334a/current/src/mipsidt_serial.c,v
retrieving revision 1.2
diff -u -w -r1.2 mipsidt_serial.c
--- packages/devs/serial/mips/idt79s334a/current/src/mipsidt_serial.c	29 Apr 2003 02:27:26 -0000	1.2
+++ packages/devs/serial/mips/idt79s334a/current/src/mipsidt_serial.c	25 Jun 2007 12:40:34 -0000
@@ -193,9 +193,13 @@
 {
     mipsidt_serial_info *mipsidt_chan = (mipsidt_serial_info *)chan->dev_priv;
     cyg_addrword_t port = mipsidt_chan->base;
-    cyg_uint32 baud_divisor = select_baud[new_config->baud]; ;
+    cyg_uint32 baud_divisor;
     cyg_uint8 _lcr, _ier;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0)
         return false;    // Invalid baud rate selected
 
Index: packages/devs/serial/mips/jmr3904/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/jmr3904/current/ChangeLog,v
retrieving revision 1.8
diff -u -w -r1.8 ChangeLog
--- packages/devs/serial/mips/jmr3904/current/ChangeLog	24 Feb 2003 14:16:59 -0000	1.8
+++ packages/devs/serial/mips/jmr3904/current/ChangeLog	25 Jun 2007 10:47:25 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/tx3904_serial.c (tx3904_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_mips_jmr3904.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/mips/jmr3904/current/src/tx3904_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/jmr3904/current/src/tx3904_serial.c,v
retrieving revision 1.4
diff -u -w -r1.4 tx3904_serial.c
--- packages/devs/serial/mips/jmr3904/current/src/tx3904_serial.c	23 May 2002 23:01:21 -0000	1.4
+++ packages/devs/serial/mips/jmr3904/current/src/tx3904_serial.c	25 Jun 2007 12:40:38 -0000
@@ -395,8 +395,12 @@
     tx3904_serial_info *tx3904_chan = (tx3904_serial_info *)chan->dev_priv;
     cyg_uint16 cr = 0;
     cyg_uint16 icr = 0;
-    cyg_uint16 baud_divisor = select_baud[new_config->baud];
+    cyg_uint16 baud_divisor;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0)
         return false;  // Invalid baud rate selected
 
Index: packages/devs/serial/mips/upd985xx/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/upd985xx/current/ChangeLog,v
retrieving revision 1.3
diff -u -w -r1.3 ChangeLog
--- packages/devs/serial/mips/upd985xx/current/ChangeLog	24 Feb 2003 14:17:27 -0000	1.3
+++ packages/devs/serial/mips/upd985xx/current/ChangeLog	25 Jun 2007 10:47:57 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/upd985xx_serial.c (upd985xx_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_mips_upd985xx.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/mips/upd985xx/current/src/upd985xx_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/upd985xx/current/src/upd985xx_serial.c,v
retrieving revision 1.2
diff -u -w -r1.2 upd985xx_serial.c
--- packages/devs/serial/mips/upd985xx/current/src/upd985xx_serial.c	23 May 2002 23:01:21 -0000	1.2
+++ packages/devs/serial/mips/upd985xx/current/src/upd985xx_serial.c	25 Jun 2007 12:40:42 -0000
@@ -147,7 +147,14 @@
     parity = select_parity[new_config->parity];
     word_length = select_word_length[new_config->word_length-CYGNUM_SERIAL_WORD_LENGTH_5];
     stop_bits = select_stop_bits[new_config->stop];
+
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
     baud = select_baud[new_config->baud];
+    if (baud == 0) {
+        return false;
+    }
 
     if ((word_length == 0xFF) ||
         (parity == 0xFF) ||
Index: packages/devs/serial/mips/vrc437x/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/vrc437x/current/ChangeLog,v
retrieving revision 1.5
diff -u -w -r1.5 ChangeLog
--- packages/devs/serial/mips/vrc437x/current/ChangeLog	24 Feb 2003 14:17:48 -0000	1.5
+++ packages/devs/serial/mips/vrc437x/current/ChangeLog	25 Jun 2007 10:48:28 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/vrc437x_serial.c (vrc437x_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_mips_vrc437x.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/mips/vrc437x/current/src/vrc437x_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mips/vrc437x/current/src/vrc437x_serial.c,v
retrieving revision 1.4
diff -u -w -r1.4 vrc437x_serial.c
--- packages/devs/serial/mips/vrc437x/current/src/vrc437x_serial.c	23 May 2002 23:01:21 -0000	1.4
+++ packages/devs/serial/mips/vrc437x/current/src/vrc437x_serial.c	25 Jun 2007 12:40:48 -0000
@@ -261,9 +261,14 @@
 {
     vrc437x_serial_info *vrc437x_chan = (vrc437x_serial_info *)chan->dev_priv;
     volatile struct serial_port *port = (volatile struct serial_port *)vrc437x_chan->base;
-    cyg_int32 baud_rate = select_baud[new_config->baud];
+    cyg_int32 baud_rate;
     cyg_int32 baud_divisor;
     unsigned char *regs = &vrc437x_chan->regs[0];
+
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_rate = select_baud[new_config->baud];
     if (baud_rate == 0) return false;
     // Compute state of registers.  The register/control state needs to be kept in
     // the shadow variable 'regs' because the hardware registers can only be written,
Index: packages/devs/serial/mn10300/mn10300/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mn10300/mn10300/current/ChangeLog,v
retrieving revision 1.7
diff -u -w -r1.7 ChangeLog
--- packages/devs/serial/mn10300/mn10300/current/ChangeLog	24 Feb 2003 14:18:05 -0000	1.7
+++ packages/devs/serial/mn10300/mn10300/current/ChangeLog	25 Jun 2007 10:49:35 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/mn10300_serial.c (mn10300_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_mn10300.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/mn10300/mn10300/current/src/mn10300_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/mn10300/mn10300/current/src/mn10300_serial.c,v
retrieving revision 1.4
diff -u -w -r1.4 mn10300_serial.c
--- packages/devs/serial/mn10300/mn10300/current/src/mn10300_serial.c	23 May 2002 23:01:22 -0000	1.4
+++ packages/devs/serial/mn10300/mn10300/current/src/mn10300_serial.c	25 Jun 2007 12:40:51 -0000
@@ -633,7 +633,13 @@
         // Serial 2 is a bit different from 0 and 1 in the way that the
         // baud rate is controlled.
 
-        cyg_uint8 baud_divisor = select_baud_2[new_config->baud].timer2_val;
+        cyg_uint8 baud_divisor;
+
+        if ((sizeof(select_baud_2)/sizeof(select_baud_2[0])) <= new_config->baud) {
+            return false;
+        }
+
+        baud_divisor = select_baud_2[new_config->baud].timer2_val;
 
         if (baud_divisor == 0)
             return false; // Invalid baud rate selected
@@ -650,9 +656,13 @@
     }
     else
     {
-        cyg_uint16 baud_divisor = select_baud_01[new_config->baud];
+        cyg_uint16 baud_divisor;
         cyg_uint8 timer_mode = 0x80;
 
+        if ((sizeof(select_baud_01)/sizeof(select_baud_01[0])) >= new_config->baud) {
+            return false;
+        }
+        baud_divisor = select_baud_01[new_config->baud];
         if (baud_divisor == 0)
             return false; // Invalid baud rate selected
 
Index: packages/devs/serial/powerpc/cme555/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/cme555/current/ChangeLog,v
retrieving revision 1.4
diff -u -w -r1.4 ChangeLog
--- packages/devs/serial/powerpc/cme555/current/ChangeLog	24 Nov 2003 14:28:14 -0000	1.4
+++ packages/devs/serial/powerpc/cme555/current/ChangeLog	25 Jun 2007 10:50:06 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/cme555_serial_with_ints.c (mpc555_serial_config_port): Added baud
+	rate range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_powerpc_cme555.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/powerpc/cme555/current/src/cme555_serial_with_ints.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/cme555/current/src/cme555_serial_with_ints.c,v
retrieving revision 1.3
diff -u -w -r1.3 cme555_serial_with_ints.c
--- packages/devs/serial/powerpc/cme555/current/src/cme555_serial_with_ints.c	24 Nov 2003 14:28:14 -0000	1.3
+++ packages/devs/serial/powerpc/cme555/current/src/cme555_serial_with_ints.c	25 Jun 2007 12:40:55 -0000
@@ -288,12 +288,16 @@
   mpc555_serial_info * mpc555_chan = (mpc555_serial_info *)(chan->dev_priv);
 
   cyg_addrword_t port = mpc555_chan->base;
-  cyg_uint16 baud_rate = select_baud[new_config->baud];
+  cyg_uint16 baud_rate;
   unsigned char frame_length = 1; // The start bit
 
   cyg_uint16 old_isrstate;
   cyg_uint16 sccxr;
 
+  if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+      return false;
+  }
+  baud_rate = select_baud[new_config->baud];
   if(!baud_rate)
     return false;    // Invalid baud rate selected
 
Index: packages/devs/serial/powerpc/cogent/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/cogent/current/ChangeLog,v
retrieving revision 1.8
diff -u -w -r1.8 ChangeLog
--- packages/devs/serial/powerpc/cogent/current/ChangeLog	24 Feb 2003 14:18:30 -0000	1.8
+++ packages/devs/serial/powerpc/cogent/current/ChangeLog	25 Jun 2007 10:50:39 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/cogent_serial_with_ints.c (cogent_serial_config_port): Added baud
+	rate range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_powerpc_cogent.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/powerpc/cogent/current/src/cogent_serial_with_ints.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/cogent/current/src/cogent_serial_with_ints.c,v
retrieving revision 1.4
diff -u -w -r1.4 cogent_serial_with_ints.c
--- packages/devs/serial/powerpc/cogent/current/src/cogent_serial_with_ints.c	23 May 2002 23:01:22 -0000	1.4
+++ packages/devs/serial/powerpc/cogent/current/src/cogent_serial_with_ints.c	25 Jun 2007 12:40:59 -0000
@@ -198,9 +198,13 @@
 {
     cogent_serial_info *cogent_chan = (cogent_serial_info *)chan->dev_priv;
     cyg_addrword_t port = cogent_chan->base;
-    cyg_uint16 baud_divisor = select_baud[new_config->baud];
+    cyg_uint16 baud_divisor;
     cyg_uint8 _lcr, _ier;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0)
         return false;    // Invalid baud rate selected
 
Index: packages/devs/serial/powerpc/ec555/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/ec555/current/ChangeLog,v
retrieving revision 1.4
diff -u -w -r1.4 ChangeLog
--- packages/devs/serial/powerpc/ec555/current/ChangeLog	24 Nov 2003 14:28:14 -0000	1.4
+++ packages/devs/serial/powerpc/ec555/current/ChangeLog	25 Jun 2007 10:51:09 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/ec555_serial_with_ints.c (mpc555_serial_config_port): Added baud
+	rate range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_powerpc_ec555.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/powerpc/ec555/current/src/ec555_serial_with_ints.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/ec555/current/src/ec555_serial_with_ints.c,v
retrieving revision 1.3
diff -u -w -r1.3 ec555_serial_with_ints.c
--- packages/devs/serial/powerpc/ec555/current/src/ec555_serial_with_ints.c	24 Nov 2003 14:28:15 -0000	1.3
+++ packages/devs/serial/powerpc/ec555/current/src/ec555_serial_with_ints.c	25 Jun 2007 12:41:02 -0000
@@ -290,12 +290,16 @@
   mpc555_serial_info * mpc555_chan = (mpc555_serial_info *)(chan->dev_priv);
 
   cyg_addrword_t port = mpc555_chan->base;
-  cyg_uint16 baud_rate = select_baud[new_config->baud];
+  cyg_uint16 baud_rate;
   unsigned char frame_length = 1; // The start bit
 
   cyg_uint16 old_isrstate;
   cyg_uint16 sccxr;
 
+  if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+      return false;
+  }
+  baud_rate = select_baud[new_config->baud];
   if(!baud_rate)
     return false;    // Invalid baud rate selected
 
Index: packages/devs/serial/powerpc/mpc8xxx/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/mpc8xxx/current/ChangeLog,v
retrieving revision 1.1
diff -u -w -r1.1 ChangeLog
--- packages/devs/serial/powerpc/mpc8xxx/current/ChangeLog	9 Nov 2003 23:09:50 -0000	1.1
+++ packages/devs/serial/powerpc/mpc8xxx/current/ChangeLog	25 Jun 2007 10:51:33 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/mpc8xxx_serial.c (mpc8xxx_smc_serial_config_port): Added baud
+	rate range validation code.
+
 2003-11-09  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/mpc8xxx_serial.h: 
Index: packages/devs/serial/powerpc/mpc8xxx/current/src/mpc8xxx_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/mpc8xxx/current/src/mpc8xxx_serial.c,v
retrieving revision 1.1
diff -u -w -r1.1 mpc8xxx_serial.c
--- packages/devs/serial/powerpc/mpc8xxx/current/src/mpc8xxx_serial.c	9 Nov 2003 23:09:51 -0000	1.1
+++ packages/devs/serial/powerpc/mpc8xxx/current/src/mpc8xxx_serial.c	25 Jun 2007 12:41:08 -0000
@@ -333,10 +333,14 @@
 mpc8xxx_smc_serial_config_port(serial_channel *chan, cyg_serial_info_t *new_config, bool init)
 {
     mpc8xxx_sxx_serial_info *smc_chan = (mpc8xxx_sxx_serial_info *)chan->dev_priv;
-    unsigned int baud_divisor = select_baud[new_config->baud];
+    unsigned int baud_divisor;
     cyg_uint32 _lcr;
     volatile struct smc_regs_8260 *ctl = (volatile struct smc_regs_8260*)smc_chan->ctl;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0) return false;
     // Disable channel during setup
     ctl->smc_smcmr = MPC8XXX_SMCMR_UART;  // Disabled, UART mode
Index: packages/devs/serial/powerpc/quicc/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/quicc/current/ChangeLog,v
retrieving revision 1.24
diff -u -w -r1.24 ChangeLog
--- packages/devs/serial/powerpc/quicc/current/ChangeLog	30 Jan 2006 23:28:35 -0000	1.24
+++ packages/devs/serial/powerpc/quicc/current/ChangeLog	25 Jun 2007 10:52:00 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/quicc_smc_serial.c (quicc_smc_serial_config_port): Added baud
+	rate range validation code.
+
 2006-01-27 Will Wagner <willw@carallon.com>
 
         * src/quicc_smc_serial.h: Removed unused structure
Index: packages/devs/serial/powerpc/quicc/current/src/quicc_smc_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/quicc/current/src/quicc_smc_serial.c,v
retrieving revision 1.19
diff -u -w -r1.19 quicc_smc_serial.c
--- packages/devs/serial/powerpc/quicc/current/src/quicc_smc_serial.c	30 Jan 2006 23:28:35 -0000	1.19
+++ packages/devs/serial/powerpc/quicc/current/src/quicc_smc_serial.c	25 Jun 2007 12:41:11 -0000
@@ -335,11 +335,15 @@
 quicc_smc_serial_config_port(serial_channel *chan, cyg_serial_info_t *new_config, bool init)
 {
     quicc_sxx_serial_info *smc_chan = (quicc_sxx_serial_info *)chan->dev_priv;
-    unsigned int baud_divisor = select_baud[new_config->baud];
+    unsigned int baud_divisor;
     cyg_uint32 _lcr;
     EPPC *eppc = eppc_base();
     volatile struct smc_regs *ctl = (volatile struct smc_regs *)smc_chan->ctl;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0) return false;
     // Disable channel during setup
     ctl->smc_smcmr = QUICC_SMCMR_UART;  // Disabled, UART mode
Index: packages/devs/serial/powerpc/quicc2/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/quicc2/current/ChangeLog,v
retrieving revision 1.4
diff -u -w -r1.4 ChangeLog
--- packages/devs/serial/powerpc/quicc2/current/ChangeLog	8 Sep 2003 14:55:42 -0000	1.4
+++ packages/devs/serial/powerpc/quicc2/current/ChangeLog	25 Jun 2007 10:52:23 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/quicc2_scc_serial.c (quicc2_scc_serial_config_port): Added baud
+	rate range validation code.
+
 2003-09-08  Gary Thomas  <gary@mlbassoc.com>
 
 	* src/quicc2_scc_serial.h: Fix baud rate clock setup - was off by 1.
Index: packages/devs/serial/powerpc/quicc2/current/src/quicc2_scc_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/powerpc/quicc2/current/src/quicc2_scc_serial.c,v
retrieving revision 1.1
diff -u -w -r1.1 quicc2_scc_serial.c
--- packages/devs/serial/powerpc/quicc2/current/src/quicc2_scc_serial.c	12 Dec 2002 21:15:31 -0000	1.1
+++ packages/devs/serial/powerpc/quicc2/current/src/quicc2_scc_serial.c	25 Jun 2007 12:41:15 -0000
@@ -209,8 +209,12 @@
     quicc2_scc_serial_info *scc_chan = (quicc2_scc_serial_info *)chan->dev_priv;
     volatile t_PQ2IMM *IMM = (volatile t_PQ2IMM *) QUICC2_VADS_IMM_BASE;
 
-    unsigned long b_rate   = select_baud[new_config->baud];
+    unsigned long b_rate;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    b_rate = select_baud[new_config->baud];
     if (b_rate == 0) return false;
 
     // Stop the transmitter while changing baud rate
Index: packages/devs/serial/sh/sci/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/sh/sci/current/ChangeLog,v
retrieving revision 1.6
diff -u -w -r1.6 ChangeLog
--- packages/devs/serial/sh/sci/current/ChangeLog	24 Feb 2003 14:19:54 -0000	1.6
+++ packages/devs/serial/sh/sci/current/ChangeLog	25 Jun 2007 10:52:59 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/sh_sci_serial.c (sh_serial_config_port): Added baud rate range
+	validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_sh_sci.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/sh/sci/current/src/sh_sci_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/sh/sci/current/src/sh_sci_serial.c,v
retrieving revision 1.5
diff -u -w -r1.5 sh_sci_serial.c
--- packages/devs/serial/sh/sci/current/src/sh_sci_serial.c	23 May 2002 23:01:23 -0000	1.5
+++ packages/devs/serial/sh/sci/current/src/sh_sci_serial.c	25 Jun 2007 12:41:18 -0000
@@ -201,10 +201,15 @@
 sh_serial_config_port(serial_channel *chan, cyg_serial_info_t *new_config, 
                       bool init)
 {
-    cyg_uint16 baud_divisor = select_baud[new_config->baud];
+    cyg_uint16 baud_divisor;
     sh_sci_info *sh_chan = (sh_sci_info *)chan->dev_priv;
     cyg_uint8 _scr, _smr;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
+
     // Check configuration request
     if ((-1 == select_word_length[(new_config->word_length -
                                   CYGNUM_SERIAL_WORD_LENGTH_5)])
Index: packages/devs/serial/sh/scif/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/sh/scif/current/ChangeLog,v
retrieving revision 1.10
diff -u -w -r1.10 ChangeLog
--- packages/devs/serial/sh/scif/current/ChangeLog	9 Aug 2005 16:12:25 -0000	1.10
+++ packages/devs/serial/sh/scif/current/ChangeLog	25 Jun 2007 10:53:33 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/sh_scif_serial.c (sh_scif_config_port): Added baud rate range
+	validation code.
+
 2005-08-04  Andrew Lunn  <andrew.lunn@ascom.ch>
 2005-05-02  Hajime Ishitani <pigmon@mail.snd.co.jp>
 
Index: packages/devs/serial/sh/scif/current/src/sh_scif_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/sh/scif/current/src/sh_scif_serial.c,v
retrieving revision 1.9
diff -u -w -r1.9 sh_scif_serial.c
--- packages/devs/serial/sh/scif/current/src/sh_scif_serial.c	9 Aug 2005 16:12:25 -0000	1.9
+++ packages/devs/serial/sh/scif/current/src/sh_scif_serial.c	25 Jun 2007 12:41:22 -0000
@@ -254,12 +254,17 @@
 sh_scif_config_port(serial_channel *chan, cyg_serial_info_t *new_config, 
                      bool init)
 {
-    cyg_uint16 baud_divisor = select_baud[new_config->baud];
+    cyg_uint16 baud_divisor;
     sh_scif_info *sh_chan = (sh_scif_info *)chan->dev_priv;
     cyg_uint8 _scr, _smr;
     cyg_uint16 _sr;
     CYG_ADDRWORD base = sh_chan->ctrl_base;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
+    baud_divisor = select_baud[new_config->baud];
+
     // Check configuration request
     if ((-1 == select_word_length[(new_config->word_length -
                                   CYGNUM_SERIAL_WORD_LENGTH_5)])
Index: packages/devs/serial/sparclite/sleb/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/sparclite/sleb/current/ChangeLog,v
retrieving revision 1.8
diff -u -w -r1.8 ChangeLog
--- packages/devs/serial/sparclite/sleb/current/ChangeLog	24 Feb 2003 14:20:37 -0000	1.8
+++ packages/devs/serial/sparclite/sleb/current/ChangeLog	25 Jun 2007 10:54:22 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/sleb_sdtr.c (sleb_sdtr_config_port): Added baud rate range
+	validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_sparclite_sleb.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/sparclite/sleb/current/src/sleb_sdtr.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/sparclite/sleb/current/src/sleb_sdtr.c,v
retrieving revision 1.5
diff -u -w -r1.5 sleb_sdtr.c
--- packages/devs/serial/sparclite/sleb/current/src/sleb_sdtr.c	23 May 2002 23:01:25 -0000	1.5
+++ packages/devs/serial/sparclite/sleb/current/src/sleb_sdtr.c	25 Jun 2007 12:41:26 -0000
@@ -188,10 +188,10 @@
     cyg_int32 baud_divisor;
     cyg_int32 clk, tval;
     unsigned char mode;
-#if 0
-    if ((new_config->baud < CYGNUM_SERIAL_BAUD_MIN) || (new_config->baud > CYGNUM_SERIAL_BAUD_MAX))
-        return false;  // Invalid baud rate
-#endif
+
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
     baud_divisor = select_baud[new_config->baud];
     if (baud_divisor == 0)
         return false; // Unsupported baud rate
Index: packages/devs/serial/v85x/v850/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/v85x/v850/current/ChangeLog,v
retrieving revision 1.11
diff -u -w -r1.11 ChangeLog
--- packages/devs/serial/v85x/v850/current/ChangeLog	24 Feb 2003 14:20:52 -0000	1.11
+++ packages/devs/serial/v85x/v850/current/ChangeLog	25 Jun 2007 10:54:57 -0000
@@ -1,3 +1,8 @@
+2007-06-25  Alexander Aganichev  <aaganichev@gmail.com>
+
+	* src/v85x_v850_serial.c (v850_serial_config_port): Added baud rate
+	range validation code.
+
 2003-02-24  Jonathan Larmour  <jifl@eCosCentric.com>
 
 	* cdl/ser_v85x_v850.cdl: Remove irrelevant doc link.
Index: packages/devs/serial/v85x/v850/current/src/v85x_v850_serial.c
===================================================================
RCS file: /cvs/ecos/ecos/packages/devs/serial/v85x/v850/current/src/v85x_v850_serial.c,v
retrieving revision 1.7
diff -u -w -r1.7 v85x_v850_serial.c
--- packages/devs/serial/v85x/v850/current/src/v85x_v850_serial.c	23 May 2002 23:01:25 -0000	1.7
+++ packages/devs/serial/v85x/v850/current/src/v85x_v850_serial.c	25 Jun 2007 12:41:31 -0000
@@ -157,6 +157,9 @@
     unsigned char stop_bits = select_stop_bits[new_config->stop];
     int divisor, count;
 
+    if ((sizeof(select_baud)/sizeof(select_baud[0])) <= new_config->baud) {
+        return false;
+    }
     if ((select_baud[new_config->baud].count == 0) ||
         (word_length == 0xFF) ||
         (parity == 0xFF) ||
