change log for rtems (2011-03-15)

rtems-vc at rtems.org rtems-vc at rtems.org
Tue Mar 15 15:10:26 UTC 2011


 *sh*:
2011-03-15	Sebastian Huber <sebastian.huber at embedded-brains.de>

	* libmisc/cpuuse/cpuusagereport.c: Avoid assumptions on execution
	context.

M 1.2777  cpukit/ChangeLog
M   1.20  cpukit/libmisc/cpuuse/cpuusagereport.c

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
@@ -1,3 +1,8 @@
+2011-03-15	Sebastian Huber <sebastian.huber at embedded-brains.de>
+
+	* libmisc/cpuuse/cpuusagereport.c: Avoid assumptions on execution
+	context.
+
 2011-03-15	Chris Johns <chrisj at rtems.org>
 
 	* libfs/src/rfs/rtems-rfs-rtems-file.c,

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
@@ -67,6 +67,7 @@
    *  guideline as to what each number means proportionally.
    */
   #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__
+    total = 0;
     uptime_at_last_reset = CPU_usage_Uptime_at_last_reset;
   #else
     for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) {


 *joel*:
2011-03-15	Joel Sherrill <joel.sherrill at oarcorp.com>

	* libmisc/shell/main_setenv.c: Address Coverity issue 134 which
	recommends using strnXXX methods.

M 1.2778  cpukit/ChangeLog
M    1.4  cpukit/libmisc/shell/main_setenv.c

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
@@ -1,3 +1,8 @@
+2011-03-15	Joel Sherrill <joel.sherrill at oarcorp.com>
+
+	* libmisc/shell/main_setenv.c: Address Coverity issue 134 which
+	recommends using strnXXX methods.
+
 2011-03-15	Sebastian Huber <sebastian.huber at embedded-brains.de>
 
 	* libmisc/cpuuse/cpuusagereport.c: Avoid assumptions on execution

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
@@ -16,6 +16,13 @@
 #include <rtems/shell.h>
 #include "internal.h"
 
+/*
+ *  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
+
 int rtems_shell_main_setenv(int argc, char *argv[])
 {
   char* env = NULL;
@@ -32,7 +39,7 @@
   env = argv[1];
 
   for (arg = 2; arg < argc; arg++)
-    len += strlen(argv[arg]);
+    len += strnlen(argv[arg], MAX);
 
   len += argc - 2 - 1;
 
@@ -44,8 +51,8 @@
   }
 
   for (arg = 2, p = string; arg < argc; arg++) {
-    strcpy(p, argv[arg]);
-    p += strlen(argv[arg]);
+    strncpy(p, argv[arg], MAX);
+    p += strnlen(argv[arg], MAX);
     if (arg < (argc - 1)) {
       *p = ' ';
       p++;


 *joel*:
2011-03-15	Joel Sherrill <joel.sherrill at 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.

M 1.2779  cpukit/ChangeLog
M   1.19  cpukit/libfs/src/dosfs/msdos_format.c

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
@@ -1,5 +1,12 @@
 2011-03-15	Joel Sherrill <joel.sherrill at 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.
+
+2011-03-15	Joel Sherrill <joel.sherrill at oarcorp.com>
+
 	* libmisc/shell/main_setenv.c: Address Coverity issue 134 which
 	recommends using strnXXX methods.
 

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
@@ -896,21 +896,29 @@
   int                  i;
   msdos_format_param_t fmt_params;
 
-  msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
-                       "formating: %s\n", devname);
+  /*
+   * 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;
+  }
+
   /*
    * sanity check on device
    */
   msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_DETAIL,
                        "stat check: %s\n", devname);
   if (ret_val == 0) {
-    rc = stat(devname, &stat_buf);
+    rc = fstat(fd, &stat_buf);
     ret_val = rc;
   }
 
+  msdos_format_printf (rqdata, MSDOS_FMT_INFO_LEVEL_INFO,
+                       "formating: %s\n", devname);
   /* rtems feature: no block devices, all are character devices */
-  if ((ret_val == 0) &&
-      (!S_ISBLK(stat_buf.st_mode))) {
+  if ((ret_val == 0) && (!S_ISBLK(stat_buf.st_mode))) {
     errno = ENOTTY;
     ret_val = -1;
   }
@@ -925,19 +933,6 @@
   }
 
   /*
-   * 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;
-    }
-  }
-
-  /*
    * compute formatting parameters
    */
   if (ret_val == 0) {
@@ -957,6 +952,7 @@
        fmt_params.bytes_per_sector,
        0xe5);
   }
+
   /*
    * create master boot record
    */
@@ -1080,7 +1076,8 @@
 
     case FAT_FAT16:
       /* FAT entry 0: 0xff00|media_type */
-      FAT_SET_VAL16(tmp_sec,0,0xff00|fmt_params.media_code);
+      FAT_SET_VAL8(tmp_sec,0,fmt_params.media_code);
+      FAT_SET_VAL8(tmp_sec,1,0xff);
       /* FAT entry 1: EOC */
       FAT_SET_VAL16(tmp_sec,2,FAT_FAT16_EOC);
       break;



--

Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20110315/5e12aaac/attachment-0001.html>


More information about the vc mailing list