Vulnerability Development mailing list archives
Re: problem with C and Gcc 2.95.3
From: Jeroen Latour <q () ds9 com>
Date: Sun, 27 May 2001 03:12:42 +0200
At 22:47 26-5-2001, you wrote:
Which is why I let the message through. Any reason why a %d stepping off the end of a buffer would end up printing out the environment like that? Or is it certain that the source that was mailed in doesn't match the output?
# cat > problem.c #include <stdio.h> main () { char buff[10]; int i; for (i=0;i<10;i++){ buff[i]='.'; } for (i=0;1<10;i++){ printf("%d",buff[i]); } } # gcc -o problem problem.c # ./problem 46464646464646464646-1-65104-5-1-65-21-1263641000-100-5-1-65-92-5-1-65-128-124480000104-5-1-65-67-126364-10490164100016-12548-100-5-1-6548-126364401031864000049-12548-16-125481000-100-5-1-65-104-12648-128-12448-64-63064-116-5-1-65-1249616411331064-92-5-1-651000-116-4-1-650000-106-4-1-65-96-4-1-65-81-4-1-65-57-4-1-65-44-4-1-65-33-4-1-65-23-4-1-65-18-2-1-659-1-1-6535-1-1-6542-1-1-6555-1-1-6563-1-1-6579-1-1-6593-1-1-65110-1-1-65121-1-1-65-124-1-1-65-45-1-1-65-26-1-1-650000300052-128484000320005000600070000006480000000900016-1254811000000012000000013000000014000000016000-651006000016001700010000015000-121-4-1-65000000000000000000000000000000010553565404647112114111981081011090808768614711411111111607279838478657769611091111101161210768395798084737978836145459911110811111461971171161110808349619210458921199236320867383856576611061111010858369826111411111111607683956779767982836111011161484858102105614848581001056148495951525810811061484959515458112105615248595151581151116148495951535810 01116148495951535898100615248595151594849589910061524859515159484958111114615248595149594849581011206148495951505842461169711461484959514958424611610312261484959514958424697114106614849595149584246116971226148495951495842461081221046148495951495842461221051126148495951495842461226148495951495842469061484959514958424610312261484959514958424698122506148495951495842461001019861484959514958424611411210961484959514958424610697114614849595149584246106112103614849595153584246106112101103614849595153584246112110103614849595153584246103105102614849595153584246981091126148495951535842461129810961484959515358424611210310961484959515358424611211210961484959515358424611610397614849595153584246120981096148495951535842461201121096148495951535842461161051026148495951535842461161051021026148495951535842461091121036148495951535842461091121011036148495951535842469711810561484959515358424610210810561484959515358424610310861484959515358424610010861484959515358424612099102614849595153584246120119100614 8 49595153580776567728489806961105515654451129945108105110Segmentation fault
# gcc -v Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs gcc version 2.95.4 20010506 (Debian prerelease)Unless the problem was fixed in 2.95.4 (which doesn't appear to be the case, according to changelog), I think the source indeed does differ. Replacing %d with %c does indeed produce similiar output as in the original mail.
Jeroen Latour
Current thread:
- problem with C and Gcc 2.95.3 Ale (May 25)
- Re: problem with C and Gcc 2.95.3 Yuri Polyansky (May 26)
- Re: problem with C and Gcc 2.95.3 Doru Petrescu (May 26)
- Re: problem with C and Gcc 2.95.3 Blue Boar (May 26)
- Re: problem with C and Gcc 2.95.3 Jeroen Latour (May 26)
- Re: problem with C and Gcc 2.95.3 Riley Hassell (May 26)
- Re: problem with C and Gcc 2.95.3 Blue Boar (May 26)