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

Re: [Xen-devel] [PATCH] xsm: fix printf format string for strlen result

On 04/29/2013 11:50 AM, Jan Beulich wrote:
On 22.04.13 at 14:28, Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:
Adding Keir + Jan.

Would really be Daniel to give his ack here. It's a trivial enough
change, so if I don't see an ack soon, I'll probably commit this


Ah, sorry about that, for some reason I didn't register that this was
waiting for my Ack since it seemed like a trivial change.

Acked-by: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>

On Mon, 2013-04-15 at 14:36 +0100, Ian Campbell wrote:
strlen returns size_t:

policydb.c: In function âpolicydb_readâ:
policydb.c:1779: error: format â%luâ expects type âlong unsigned intâ, but
argument 3 has type âsize_tâ

This is probably benign on 64-bit x86 but was found by Dharshini on 32-bit
4.2.x. I expect it affects ARM too.

Reported-by: Dharshini Tharmaraj <dharshinitharmaraj@xxxxxxxxx>
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Cc: Daniel De Graaf <dgdegra@xxxxxxxxxxxxx>
  xen/xsm/flask/ss/policydb.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/xen/xsm/flask/ss/policydb.c b/xen/xsm/flask/ss/policydb.c
index fefcd59..bdec4ac 100644
--- a/xen/xsm/flask/ss/policydb.c
+++ b/xen/xsm/flask/ss/policydb.c
@@ -1737,7 +1737,7 @@ int policydb_read(struct policydb *p, void *fp)
      if ( len != strlen(POLICYDB_STRING) )
          printk(KERN_ERR "Flask:  policydb string length %d does not "
-               "match expected length %lu\n",
+               "match expected length %zu\n",
                 len, strlen(POLICYDB_STRING));
          goto bad;

Xen-devel mailing list



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