Hello,
Patch against 2.6.26.
ss/services.c null character style fix attached.
In my opinion, it is better C-style to use the escaped version
of null character when we deal with C-strings. So I always prefer:
c = '\0';
to the
c = 0;
although both are standards-compliant and correct.
Best regards,
vmk
--
************************************************************************
Tietotekniikkaosasto / Helsingin yliopisto
IT Department / University of Helsinki
************************************************************************
--- linux-2.6.26/security/selinux/ss/services.c 2008-07-14 00:51:29.000000000 +0300
+++ linux-2.6.26-vmk/security/selinux/ss/services.c 2008-07-20 14:18:51.000000000 +0300
@@ -744,7 +744,7 @@
goto out;
}
memcpy(scontext2, scontext, scontext_len);
- scontext2[scontext_len] = 0;
+ scontext2[scontext_len] = '\0';
context_init(&context);
*sid = SECSID_NULL;
@@ -761,10 +761,10 @@
while (*p && *p != ':')
p++;
- if (*p == 0)
+ if (*p == '\0')
goto out_unlock;
- *p++ = 0;
+ *p++ = '\0';
usrdatum = hashtab_search(policydb.p_users.table, scontextp);
if (!usrdatum)
@@ -777,10 +777,10 @@
while (*p && *p != ':')
p++;
- if (*p == 0)
+ if (*p == '\0')
goto out_unlock;
- *p++ = 0;
+ *p++ = '\0';
role = hashtab_search(policydb.p_roles.table, scontextp);
if (!role)
@@ -792,7 +792,7 @@
while (*p && *p != ':')
p++;
oldc = *p;
- *p++ = 0;
+ *p++ = '\0';
typdatum = hashtab_search(policydb.p_types.table, scontextp);
if (!typdatum)