[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xen/xsm/flask: Fix Flask MLS context generation



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1251208687 -3600
# Node ID dc2aebb0e1d08b98a11d2e8a3bf7dc6435338e7f
# Parent  34c489308d45c72442703fec8f9956305c9e72c7
xen/xsm/flask:  Fix Flask MLS context generation

Signed-off-by:  Stephen D. Smalley <sds@xxxxxxxxxxxxx>
---
 xen/xsm/flask/ss/mls.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff -r 34c489308d45 -r dc2aebb0e1d0 xen/xsm/flask/ss/mls.c
--- a/xen/xsm/flask/ss/mls.c    Tue Aug 25 14:57:45 2009 +0100
+++ b/xen/xsm/flask/ss/mls.c    Tue Aug 25 14:58:07 2009 +0100
@@ -105,7 +105,7 @@ void mls_sid_to_context(struct context *
     {
         memcpy(scontextp,
                 policydb.p_sens_val_to_name[context->range.level[l].sens - 1],
-                
strlen(policydb.p_sens_val_to_name[context->range.level[l].sens - 1]));
+                
strlen(policydb.p_sens_val_to_name[context->range.level[l].sens - 1])+1);
         scontextp += strlen(scontextp);
 
         /* categories */
@@ -124,7 +124,7 @@ void mls_sid_to_context(struct context *
                     else
                         *scontextp++ = ',';
                     nm = policydb.p_cat_val_to_name[prev];
-                    memcpy(scontextp, nm, strlen(nm));
+                    memcpy(scontextp, nm, strlen(nm)+1);
                     scontextp += strlen(nm);
                 }
                 if ( prev < 0 )
@@ -132,7 +132,7 @@ void mls_sid_to_context(struct context *
                 else
                     *scontextp++ = ',';
                 nm = policydb.p_cat_val_to_name[i];
-                memcpy(scontextp, nm, strlen(nm));
+                memcpy(scontextp, nm, strlen(nm)+1);
                 scontextp += strlen(nm);
                 head = i;
             }
@@ -146,7 +146,7 @@ void mls_sid_to_context(struct context *
             else
                 *scontextp++ = ',';
             nm = policydb.p_cat_val_to_name[prev];
-            memcpy(scontextp, nm, strlen(nm));
+            memcpy(scontextp, nm, strlen(nm)+1);
             scontextp += strlen(nm);
         }
 

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.