Browse Source

* ftparchive/cachedb.cc:

- fix buffersize in bytes2hex

* ftparchive/cachedb.cc:
  - make buffer fully dynamic (thanks to Colin Watson)
tags/debian/0.8.15.9
Michael Vogt 9 years ago
parent
commit
324fc8af29
2 changed files with 17 additions and 5 deletions
  1. +8
    -0
      debian/changelog
  2. +9
    -5
      ftparchive/cachedb.cc

+ 8
- 0
debian/changelog View File

@@ -7,6 +7,14 @@ apt (0.8.15.9) UNRELEASED; urgency=low
[ David Kalnischkies ]
* Symbol file update

[ Colin Watson ]
* ftparchive/cachedb.cc:
- fix buffersize in bytes2hex
[ Michael Vogt ]
* ftparchive/cachedb.cc:
- make buffer fully dynamic (thanks to Colin Watson)
-- Christian Perrier <bubulle@debian.org> Wed, 14 Sep 2011 20:13:40 +0200

apt (0.8.15.8) unstable; urgency=low


+ 9
- 5
ftparchive/cachedb.cc View File

@@ -294,11 +294,15 @@ bool CacheDB::LoadContents(bool const &GenOnly)
/*}}}*/

static string bytes2hex(uint8_t *bytes, size_t length) {
char space[65];
if (length * 2 > sizeof(space) - 1) length = (sizeof(space) - 1) / 2;
for (size_t i = 0; i < length; i++)
snprintf(&space[i*2], 3, "%02x", bytes[i]);
return string(space);
char buf[3];
string space;

space.reserve(length*2 + 1);
for (size_t i = 0; i < length; i++) {
snprintf(buf, sizeof(buf), "%02x", bytes[i]);
space.append(buf);
}
return space;
}

static inline unsigned char xdig2num(char const &dig) {


Loading…
Cancel
Save