From 6ad9bbf0367b46379c4407519a2b125c6e9e127b Mon Sep 17 00:00:00 2001 From: imcd Date: Thu, 16 Aug 2007 20:42:11 +0000 Subject: [PATCH] Fix infinite loop when parsing numeric trace flags written to /proc/yaffs. --- yaffs_fs.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/yaffs_fs.c b/yaffs_fs.c index 6e5aa70..b83794f 100644 --- a/yaffs_fs.c +++ b/yaffs_fs.c @@ -32,7 +32,7 @@ */ const char *yaffs_fs_c_version = - "$Id: yaffs_fs.c,v 1.61 2007-07-18 19:40:38 charles Exp $"; + "$Id: yaffs_fs.c,v 1.62 2007-08-16 20:42:11 imcd Exp $"; extern const char *yaffs_guts_c_version; #include @@ -2128,6 +2128,7 @@ static int yaffs_proc_write(struct file *file, const char *buf, if (end > buf + pos) { mask_name = "numeral"; len = end - (buf + pos); + pos += len; done = 0; } else { for(x = buf + pos, i = 0; @@ -2137,8 +2138,6 @@ static int yaffs_proc_write(struct file *file, const char *buf, substring[i] = '\0'; for (i = 0; mask_flags[i].mask_name != NULL; i++) { - //len = strlen(mask_flags[i].mask_name); - //if (strncmp(buf + pos, mask_flags[i].mask_name, len) == 0) { if(strcmp(substring,mask_flags[i].mask_name) == 0){ mask_name = mask_flags[i].mask_name; mask_bitfield = mask_flags[i].mask_bitfield; @@ -2149,7 +2148,6 @@ static int yaffs_proc_write(struct file *file, const char *buf, } if (mask_name != NULL) { - // pos += len; done = 0; switch(add) { case '-': -- 2.30.2