Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


Cleanup and sanity-checking of use of strncpy/strcpy (Coverity static analysis)
[palacios.git] / linux_module / iface-stream.c
index 27bfe42..207f5f0 100644 (file)
@@ -246,7 +246,8 @@ static void * palacios_stream_open(struct v3_stream * v3_stream, const char * na
     stream->guest = guest;
     stream->connected = 0;
 
-    strncpy(stream->name, name, STREAM_NAME_LEN - 1);
+    strncpy(stream->name, name, STREAM_NAME_LEN);
+    stream->name[STREAM_NAME_LEN-1] = 0;
 
     init_waitqueue_head(&(stream->user_poll_queue));
     palacios_spinlock_init(&(stream->lock));
@@ -400,6 +401,9 @@ static int guest_stream_deinit(struct v3_guest * guest, void * vm_data) {
     struct stream_state * stream = NULL;
     struct stream_state * tmp = NULL;
 
+
+    remove_guest_ctrl(guest, V3_VM_STREAM_CONNECT);
+
     list_for_each_entry_safe(stream, tmp, &(global_streams), stream_node) {
         free_ringbuf(stream->out_ring);
         list_del(&(stream->stream_node));
@@ -407,6 +411,7 @@ static int guest_stream_deinit(struct v3_guest * guest, void * vm_data) {
     }
     
     palacios_free(state);
+
     
     return 0;
 }