[botan-devel] Botan 1.11.25 bug in DataSource

Falko Strenzke fstrenzke at cryptosource.de
Mon Dec 28 13:21:09 EST 2015


Hi Jack,

I just found a bug in data_src.cpp of Botan 1.11.25:

================
size_t DataSource::discard_next(size_t n)
   {
   byte buf[64] = { 0 };
   size_t discarded = 0;

   while(n)
      {
      const size_t got = this->read(buf, std::min(n, sizeof(buf)));
      discarded += got;
      n -= got;  // *******THIS LINE IS MISSING*******
      if(got == 0)
         break;
      }

   return discarded;
   }
=================


It showed up when I tried to write an S/MIME parser with Botan, since
there the find_eoc() function is used, which in turn uses discard_next().

Falko

-- 

cryptosource logo

Dr. Falko Strenzke
Dipl-Phys.
Geschäftsführer /
Managing Director

	cryptosource GmbH
Pallaswiesenstr. 182
64293 Darmstadt
Tel.: 	+49 (0) 6151 / 86 22 379
Fax.: 	+49 (0) 6151 / 786 65 80
Mobil.: 	+49 (0) 177 / 898 53 28

Email: fstrenzke at cryptosource.de <mailto:fstrenzke at cryptosource.de>
Internet: www.cryptosource.de <http://www.cryptosource.de>
	Geschäftsführer: Dr. Falko Strenzke
Unternehmenssitz: Darmstadt
Registergericht: Amtsgericht Darmstadt
Handelsregister-Nummer: HRB 93037
Umsatzsteuer-ID: DE294145062


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20151228/0297a9e1/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: logo.jpg
Type: image/jpeg
Size: 9937 bytes
Desc: not available
URL: <http://lists.randombit.net/pipermail/botan-devel/attachments/20151228/0297a9e1/attachment-0001.jpg>


More information about the botan-devel mailing list