Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 10 Jul 2017 16:44:45 +0200
From: Jens Gustedt <jens.gustedt@...ia.fr>
To: musl@...ts.openwall.com
Subject: Re: [PATCH] handle whitespace before %% in scanf

Hello Bartosz,

On Mon, 10 Jul 2017 10:22:37 +0200 Bartosz Brachaczek
<b.brachaczek@...il.com> wrote:

> > EXAMPLE 5 The call:
> > 
> >     #include <stdio.h>
> >     /* ... */
> >     int n, i;
> >     n = sscanf("foo % bar 42", "foo%%bar%d", &i);
> > 
> > will assign to 'n' the value 1 and to 'i' the value 42 because input
> > white-space characters are skipped for both the '%' and 'd'
> > conversion specifiers.  
> 
> Now, the code in the example is clearly broken, as either the format 
> string should be "foo%% bar%d" or the input string should be
> "foo %bar 42", but the explanation does imply that '%%' consumes
> whitespace.

Yes, I have noted this as an editorial fix for C17

Thanks for reporting
Jens

-- 
:: INRIA Nancy Grand Est ::: Camus ::::::: ICube/ICPS :::
:: ::::::::::::::: office Strasbourg : +33 368854536   ::
:: :::::::::::::::::::::: gsm France : +33 651400183   ::
:: ::::::::::::::: gsm international : +49 15737185122 ::
:: http://icube-icps.unistra.fr/index.php/Jens_Gustedt ::

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.