mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Kjellerstedt <peter.kjellerstedt@axis.com>
To: "'Peter Wächtler'" <pwaechtler@loewe-komp.de>,
	"René Scharfe" <l.s.r@web.de>
Cc: Linus Torvalds <torvalds@transmeta.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] strtok --> strsep in framebuffer drivers (part 2)
Date: Thu, 25 Oct 2001 15:44:40 +0200	[thread overview]
Message-ID: <B6B64A8D263A4945BB5DCF3F9F400EB495455E@mailse02.axis.se> (raw)

> -----Original Message-----
> From: Peter Wächtler [mailto:pwaechtler@loewe-komp.de]
> Sent: 25 October 2001 15:36
> To: René Scharfe
> Cc: Linus Torvalds; Linux Kernel Mailing List
> Subject: Re: [PATCH] strtok --> strsep in framebuffer drivers (part 2)
> 
> René Scharfe wrote:
> > 
> > Hello,
> > 
> > I just noticed two framebuffer drivers with strtok calls 
> > that somehow passed below my radar (cscope). Patch below
> > converts them, too. And it re-adds "ignore empty tokens"
> > functionalty, which I forgot about the last time. Please apply.
> > 
> > René

[snip]

> > diff -Nur ../linux-2.4.13-pre6/drivers/video/riva/fbdev.c 
> ./drivers/video/riva/fbdev.c
> > --- ../linux-2.4.13-pre6/drivers/video/riva/fbdev.c     Tue 
> Oct 23 22:13:43 2001
> > +++ ./drivers/video/riva/fbdev.c        Tue Oct 23 23:31:33 2001
> > @@ -2046,6 +2046,8 @@
> >                 return 0;
> > 
> >         while (this_opt = strsep(&options, ",")) {
> > +               if (!*this_opt)
> > +                       continue;
> 
> NAME
>        strsep - extract token from string
> [...]
> RETURN VALUE
>        The strsep() function returns a pointer to the  token,  or
>        NULL if delim is not found in stringp.
> 
> If strsep returns NULL, and you dereference it -> Oops.
> 
> 
> ! if (!this_opt)
> 	continue;

If strsep() returns NULL, then the while-loop will terminate.
Thus this is already taken care of.

//Peter

             reply	other threads:[~2001-10-25 13:44 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-25 13:44 Peter Kjellerstedt [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-10-24 23:22 René Scharfe
2001-10-25 13:36 ` Peter Wächtler

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=B6B64A8D263A4945BB5DCF3F9F400EB495455E@mailse02.axis.se \
    --to=peter.kjellerstedt@axis.com \
    --cc=l.s.r@web.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pwaechtler@loewe-komp.de \
    --cc=torvalds@transmeta.com \
    /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

all inboxes | Powered by JetHome®