<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>change log for rtems (2011-03-15)</title>
</head>
<body text='#000000' bgcolor='#ffffff'>
<a name='cs1'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>sh</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-15 Sebastian Huber <sebastian.huber@embedded-brains.de>

        * libmisc/cpuuse/cpuusagereport.c: Avoid assumptions on execution
        context.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2776&r2=text&tr2=1.2777&diff_format=h">M</a></td><td width='1%'>1.2777</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/cpuuse/cpuusagereport.c.diff?r1=text&tr1=1.19&r2=text&tr2=1.20&diff_format=h">M</a></td><td width='1%'>1.20</td><td width='100%'>cpukit/libmisc/cpuuse/cpuusagereport.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2776 rtems/cpukit/ChangeLog:1.2777
--- rtems/cpukit/ChangeLog:1.2776       Tue Mar 15 02:32:39 2011
+++ rtems/cpukit/ChangeLog      Tue Mar 15 09:52:31 2011
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2011-03-15    Sebastian Huber <sebastian.huber@embedded-brains.de>
+
+       * libmisc/cpuuse/cpuusagereport.c: Avoid assumptions on execution
+       context.
+
</font> 2011-03-15        Chris Johns <chrisj@rtems.org>
 
        * libfs/src/rfs/rtems-rfs-rtems-file.c,

<font color='#006600'>diff -u rtems/cpukit/libmisc/cpuuse/cpuusagereport.c:1.19 rtems/cpukit/libmisc/cpuuse/cpuusagereport.c:1.20
--- rtems/cpukit/libmisc/cpuuse/cpuusagereport.c:1.19   Mon Mar  7 08:55:05 2011
+++ rtems/cpukit/libmisc/cpuuse/cpuusagereport.c        Tue Mar 15 09:52:32 2011
</font><font color='#997700'>@@ -67,6 +67,7 @@
</font>    *  guideline as to what each number means proportionally.
    */
   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
<font color='#000088'>+    total = 0;
</font>     uptime_at_last_reset = CPU_usage_Uptime_at_last_reset;
   #else
     for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {
</pre>
<p> </p>
<a name='cs2'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com>

        * libmisc/shell/main_setenv.c: Address Coverity issue 134 which
        recommends using strnXXX methods.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2777&r2=text&tr2=1.2778&diff_format=h">M</a></td><td width='1%'>1.2778</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libmisc/shell/main_setenv.c.diff?r1=text&tr1=1.3&r2=text&tr2=1.4&diff_format=h">M</a></td><td width='1%'>1.4</td><td width='100%'>cpukit/libmisc/shell/main_setenv.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2777 rtems/cpukit/ChangeLog:1.2778
--- rtems/cpukit/ChangeLog:1.2777       Tue Mar 15 09:52:31 2011
+++ rtems/cpukit/ChangeLog      Tue Mar 15 10:02:41 2011
</font><font color='#997700'>@@ -1,3 +1,8 @@
</font><font color='#000088'>+2011-03-15    Joel Sherrill <joel.sherrill@oarcorp.com>
+
+       * libmisc/shell/main_setenv.c: Address Coverity issue 134 which
+       recommends using strnXXX methods.
+
</font> 2011-03-15        Sebastian Huber <sebastian.huber@embedded-brains.de>
 
        * libmisc/cpuuse/cpuusagereport.c: Avoid assumptions on execution

<font color='#006600'>diff -u rtems/cpukit/libmisc/shell/main_setenv.c:1.3 rtems/cpukit/libmisc/shell/main_setenv.c:1.4
--- rtems/cpukit/libmisc/shell/main_setenv.c:1.3        Sat Aug 28 15:10:00 2010
+++ rtems/cpukit/libmisc/shell/main_setenv.c    Tue Mar 15 10:02:41 2011
</font><font color='#997700'>@@ -16,6 +16,13 @@
</font> #include <rtems/shell.h>
 #include "internal.h"
 
<font color='#000088'>+/*
+ *  Limit examining or copying more than 256 characters at a time.
+ *  Yes, this is very arbitrary.  If there are POSIX constants, then
+ *  they should be used.
+ */
+#define MAX 156
+
</font> int rtems_shell_main_setenv(int argc, char *argv[])
 {
   char* env = NULL;
<font color='#997700'>@@ -32,7 +39,7 @@
</font>   env = argv[1];
 
   for (arg = 2; arg < argc; arg++)
<font color='#880000'>-    len += strlen(argv[arg]);
</font><font color='#000088'>+    len += strnlen(argv[arg], MAX);
</font> 
   len += argc - 2 - 1;
 
<font color='#997700'>@@ -44,8 +51,8 @@
</font>   }
 
   for (arg = 2, p = string; arg < argc; arg++) {
<font color='#880000'>-    strcpy(p, argv[arg]);
-    p += strlen(argv[arg]);
</font><font color='#000088'>+    strncpy(p, argv[arg], MAX);
+    p += strnlen(argv[arg], MAX);
</font>     if (arg < (argc - 1)) {
       *p = ' ';
       p++;
</pre>
<p> </p>
<a name='cs3'></a>
<table border='0' cellspacing='0' cellpadding='5' width='100%' bgcolor='#eeeeee'>
<tr><td colspan='3' bgcolor='#dddddd'>
 <font color='#bb2222'><strong>joel</strong></font>
</td></tr>
<tr><td colspan='3' bgcolor='#dddddd'><pre>2011-03-15 Joel Sherrill <joel.sherrill@oarcorp.com>

        * libfs/src/dosfs/msdos_format.c: Address Coverity issue 183 which was
        where an expression evaluated to a constant and issue 185 which was a
        potential (although unlikely in expected usage) time-of-check,
        time-of-use race condition.
</pre></td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/ChangeLog.diff?r1=text&tr1=1.2778&r2=text&tr2=1.2779&diff_format=h">M</a></td><td width='1%'>1.2779</td><td width='100%'>cpukit/ChangeLog</td></tr>
<tr><td width='1%'><a href="http://www.rtems.com/cgi-bin/viewcvs.cgi//rtems/cpukit/libfs/src/dosfs/msdos_format.c.diff?r1=text&tr1=1.18&r2=text&tr2=1.19&diff_format=h">M</a></td><td width='1%'>1.19</td><td width='100%'>cpukit/libfs/src/dosfs/msdos_format.c</td></tr>
</table>
<pre>
<font color='#006600'>diff -u rtems/cpukit/ChangeLog:1.2778 rtems/cpukit/ChangeLog:1.2779
--- rtems/cpukit/ChangeLog:1.2778       Tue Mar 15 10:02:41 2011
+++ rtems/cpukit/ChangeLog      Tue Mar 15 10:05:28 2011
</font><font color='#997700'>@@ -1,5 +1,12 @@
</font> 2011-03-15        Joel Sherrill <joel.sherrill@oarcorp.com>
 
<font color='#000088'>+   * libfs/src/dosfs/msdos_format.c: Address Coverity issue 183 which was
+       where an expression evaluated to a constant and issue 185 which was a
+       potential (although unlikely in expected usage) time-of-check,
+       time-of-use race condition.
+
+2011-03-15     Joel Sherrill <joel.sherrill@oarcorp.com>
+
</font>   * libmisc/shell/main_setenv.c: Address Coverity issue 134 which
        recommends using strnXXX methods.
 

<font color='#006600'>diff -u rtems/cpukit/libfs/src/dosfs/msdos_format.c:1.18 rtems/cpukit/libfs/src/dosfs/msdos_format.c:1.19
--- rtems/cpukit/libfs/src/dosfs/msdos_format.c:1.18    Sun Jul  4 09:53:46 2010
+++ rtems/cpukit/libfs/src/dosfs/msdos_format.c Tue Mar 15 10:05:29 2011
</font><font color='#997700'>@@ -896,21 +896,29 @@
</font>   int                  i;
   msdos_format_param_t fmt_params;
 
<font color='#880000'>-  msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
-                       "formating: %s\n", devname);
</font><font color='#000088'>+  /*
+   * open device for writing
+   */
+  msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL, "open device\n");
+  fd = open(devname, O_RDWR);
+  if (fd == -1) {
+    ret_val= -1;
+  }
+
</font>   /*
    * sanity check on device
    */
   msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
                        "stat check: %s\n", devname);
   if (ret_val == 0) {
<font color='#880000'>-    rc = stat(devname, &stat_buf);
</font><font color='#000088'>+    rc = fstat(fd, &stat_buf);
</font>     ret_val = rc;
   }
 
<font color='#000088'>+  msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
+                       "formating: %s\n", devname);
</font>   /* rtems feature: no block devices, all are character devices */
<font color='#880000'>-  if ((ret_val == 0) &&
-      (!S_ISBLK(stat_buf.st_mode))) {
</font><font color='#000088'>+  if ((ret_val == 0) && (!S_ISBLK(stat_buf.st_mode))) {
</font>     errno = ENOTTY;
     ret_val = -1;
   }
<font color='#997700'>@@ -925,19 +933,6 @@
</font>   }
 
   /*
<font color='#880000'>-   * open device for writing
-   */
-  if (ret_val == 0) {
-    msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
-                         "open device\n");
-    fd = open(devname, O_RDWR);
-    if (fd == -1)
-    {
-      ret_val= -1;
-    }
-  }
-
-  /*
</font>    * compute formatting parameters
    */
   if (ret_val == 0) {
<font color='#997700'>@@ -957,6 +952,7 @@
</font>        fmt_params.bytes_per_sector,
        0xe5);
   }
<font color='#000088'>+
</font>   /*
    * create master boot record
    */
<font color='#997700'>@@ -1080,7 +1076,8 @@
</font> 
     case FAT_FAT16:
       /* FAT entry 0: 0xff00|media_type */
<font color='#880000'>-      FAT_SET_VAL16(tmp_sec,0,0xff00|fmt_params.media_code);
</font><font color='#000088'>+      FAT_SET_VAL8(tmp_sec,0,fmt_params.media_code);
+      FAT_SET_VAL8(tmp_sec,1,0xff);
</font>       /* FAT entry 1: EOC */
       FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
       break;
</pre>
<p> </p>

<p>--<br />
<small>Generated by <a href="http://www.codewiz.org/projects/index.html#loginfo">Deluxe Loginfo</a> 2.122 by Bernardo Innocenti <bernie@develer.com></small></p>
</body>
</html>