Hi Denys, all:

Not sure, but this pointer arithmetic inside 'sizeof' operator seems wrong.

Just send it here a patch to review/apply in case my assumption is correct.


--
Javier Viguera
Software Engineer
Digi International® Spain S.A.U.
>From 2ef8a3af6dde3a5c83d62f900a1109d275fdf9c8 Mon Sep 17 00:00:00 2001
From: Javier Viguera <[email protected]>
Date: Fri, 27 Jan 2012 18:30:20 +0100
Subject: [PATCH] mdev: fix wrong sizeof

Signed-off-by: Javier Viguera <[email protected]>
---
 util-linux/mdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/util-linux/mdev.c b/util-linux/mdev.c
index e5f0c2d..9765688 100644
--- a/util-linux/mdev.c
+++ b/util-linux/mdev.c
@@ -783,7 +783,7 @@ int mdev_main(int argc UNUSED_PARAM, char **argv)
 				int seqlen;
 				char seqbuf[sizeof(int)*3 + 2];
 
-				seqlen = open_read_close("mdev.seq", seqbuf, sizeof(seqbuf-1));
+				seqlen = open_read_close("mdev.seq", seqbuf, sizeof(seqbuf) - 1);
 				if (seqlen < 0) {
 					seq = NULL;
 					break;
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to