------------------------------------------------------------
revno: 1390
committer: James Hunt <[email protected]>
branch nick: upstart
timestamp: Fri 2012-11-23 11:36:47 +0000
message:
  [ Colin King <[email protected]> ]
  
  * init/log.c: log_serialise(): smatch-found issue where
    additional checks required for log->unflushed to avoid any
    possibility of NULL dereference.
  * init/state.c: state_read_objects(): smatch-found issue
    to correct read size and ensure optimal throughput.
modified:
  ChangeLog
  init/log.c
  init/state.c


--
lp:upstart
https://code.launchpad.net/~upstart-devel/upstart/trunk

Your team Upstart Reviewers is subscribed to branch lp:upstart.
To unsubscribe from this branch go to 
https://code.launchpad.net/~upstart-devel/upstart/trunk/+edit-subscription
=== modified file 'ChangeLog'
--- ChangeLog	2012-11-18 18:21:54 +0000
+++ ChangeLog	2012-11-23 11:36:47 +0000
@@ -1,3 +1,13 @@
+2012-11-23  James Hunt  <[email protected]>
+
+	[ Colin King <[email protected]> ]
+
+	* init/log.c: log_serialise(): smatch-found issue where
+	  additional checks required for log->unflushed to avoid any
+	  possibility of NULL dereference.
+	* init/state.c: state_read_objects(): smatch-found issue
+	  to correct read size and ensure optimal throughput.
+
 2012-11-18  Steve Langasek  <[email protected]>
 
 	* init/tests/test_job_process.c: fix test which was accidentally

=== modified file 'init/log.c'
--- init/log.c	2012-11-14 14:47:19 +0000
+++ init/log.c	2012-11-23 11:36:47 +0000
@@ -848,7 +848,7 @@
 	}
 
 	/* Attempt to flush any cached data */
-	if (log->unflushed->len) {
+	if (log->unflushed && log->unflushed->len) {
 		/* Don't check return values since if this fails and
 		 * unflushed data remains, we encode it below.
 		 */
@@ -879,7 +879,7 @@
 	/* Encode unflushed data as hex to ensure any embedded
 	 * nulls are handled.
 	 */
-	if (log->unflushed->len) {
+	if (log->unflushed && log->unflushed->len) {
 		unflushed_hex = state_data_to_hex (NULL,
 				log->unflushed->buf,
 				log->unflushed->len);

=== modified file 'init/state.c'
--- init/state.c	2012-11-07 11:56:33 +0000
+++ init/state.c	2012-11-23 11:36:47 +0000
@@ -227,7 +227,7 @@
 		if (nih_io_buffer_resize (buffer, initial_size) < 0)
 			goto error;
 
-		ret = read (fd, buf, sizeof (buf));
+		ret = read (fd, buf, initial_size);
 		if (ret < 0) {
 			if (errno != EINTR && errno != EAGAIN && errno != EWOULDBLOCK)
 				goto error;

-- 
upstart-devel mailing list
[email protected]
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/upstart-devel

Reply via email to