public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Horms <horms@debian.org>
To: Marcelo Tosatti <marcelo.tosatti@cyclades.com>,
	Alexander Pytlev <apytlev@tut.by>,
	linux-kernel@vger.kernel.org, debian-kernel@lists.debian.org,
	"Andrey J. Melnikoff (TEMHOTA)" <temnota@kmv.ru>,
	Willy Tarreau <willy@w.ods.org>
Subject: [PATCH] Bogus code in parsing of iocharset in isofs
Date: Tue, 16 Aug 2005 17:46:12 +0900	[thread overview]
Message-ID: <20050816084610.GB31717@debian.org> (raw)
In-Reply-To: <20050816083807.GA31717@debian.org>

Hi, 

this is a followup for the patch I sent earlier (like about 2 minutes
ago) regarding isofs options parsing. In the course of debuging this
Marcelo pointed out the following code

#ifdef CONFIG_JOLIET
                if (!strcmp(this_char,"iocharset") && value) {
                        popt->iocharset = value;
                        while (*value && *value != ',')
                                value++;
                        if (value == popt->iocharset)
                                return 0;
                        *value = 0;
                } else 
#endif              

On inspection it turns out that because of use of strtok(),
*value is already NULL terminated, and thus the code snippet
above is largely bogus. The following patch should remove the
bogus code without changing functionality.

Signed-off-by: Horms <horms@verge.net.au>

--- ../build-386/fs/isofs/inode.c	2005-08-03 14:46:33.000000000 +0900
+++ fs/isofs/inode.c	2005-08-16 17:23:04.000000000 +0900
@@ -324,12 +324,9 @@
 
 #ifdef CONFIG_JOLIET
 		if (!strcmp(this_char,"iocharset") && value) {
-			popt->iocharset = value;
-			while (*value && *value != ',')
-				value++;
-			if (value == popt->iocharset)
+			if (!value)
 				return 0;
-			*value = 0;
+			popt->iocharset = value;
 		} else
 #endif
 		if (!strcmp(this_char,"map") && value) {

      reply	other threads:[~2005-08-16  8:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1853917171.20050812104417@tut.by>
2005-08-12  8:29 ` kernel 2.4.27-10: isofs driver ignore some parameters with mount Horms
2005-08-12  8:41   ` Horms
2005-08-16  1:11   ` Marcelo Tosatti
2005-08-16  5:31     ` Horms
2005-08-16  8:38       ` Horms
2005-08-16  8:46         ` Horms [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20050816084610.GB31717@debian.org \
    --to=horms@debian.org \
    --cc=apytlev@tut.by \
    --cc=debian-kernel@lists.debian.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo.tosatti@cyclades.com \
    --cc=temnota@kmv.ru \
    --cc=willy@w.ods.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox