diff options
author | bmah <bmah@FreeBSD.org> | 2002-09-06 19:51:58 +0000 |
---|---|---|
committer | bmah <bmah@FreeBSD.org> | 2002-09-06 19:51:58 +0000 |
commit | 5419354c9fc7ce9e7f3f8f8c77527836b83b3d93 (patch) | |
tree | 011e0ffa4ed51ebf7fb46f41f172be3c666558bb /lib/libmd/mdXhl.c | |
parent | c10ceae56a2dcab0df16330b6c5cce72b702bfdf (diff) | |
download | FreeBSD-src-5419354c9fc7ce9e7f3f8f8c77527836b83b3d93.zip FreeBSD-src-5419354c9fc7ce9e7f3f8f8c77527836b83b3d93.tar.gz |
Fix a bug where calling MD5File(3) with a zero-length file generated an
error, due to an uninitialized variable.
Reviewed by: phk, archie
Diffstat (limited to 'lib/libmd/mdXhl.c')
-rw-r--r-- | lib/libmd/mdXhl.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libmd/mdXhl.c b/lib/libmd/mdXhl.c index 439e9ff..ae96813 100644 --- a/lib/libmd/mdXhl.c +++ b/lib/libmd/mdXhl.c @@ -66,6 +66,7 @@ MDXFileChunk(const char *filename, char *buf, off_t ofs, off_t len) len = stbuf.st_size - ofs; if (lseek(f, ofs, SEEK_SET) < 0) return 0; n = len; + i = 0; while (n > 0) { if (n > sizeof(buffer)) i = read(f, buffer, sizeof(buffer)); |