On 08/ 5/13 04:35 PM, Alan Coopersmith wrote:
+    fgets(Buffer, (Buffer_size - 1), stdin);
+    sscanf(Buffer,"%s");

Oops, forgot to mention the sscanf is still wrong in this second revision.
This code now reads a line from stdin and writes it to Buffer.  The sscanf
now takes Buffer as input, looks for a string pattern matching %s and writes
it to, well, whatever the random uninitialized value is next on the stack,
because there is no output argument provided for the %s.   Fortunately,
gcc -Wformat should find this and error out before anyone ships it.

Of course, since this is used in a function that expects the string to be
returned in Buffer, having sscanf read from Buffer and write the result
somewhere else is also counterproductive.

--
        -Alan Coopersmith-              alan.coopersm...@oracle.com
         Oracle Solaris Engineering - http://blogs.oracle.com/alanc


--
To UNSUBSCRIBE, email to debian-bugs-rc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to