Skip to content

Commit

Permalink
fix a crasher in sk.c caused by a recent patch
Browse files Browse the repository at this point in the history
Ignore-this: 7117980c3c29174eee253121a4893b57
Fix a bug introduced in a previous patch.

darcs-hash:20090501013346-cb76d-8c62945585e7754d0b6441f3fe90eabca3637b99.gz
  • Loading branch information
david.collett committed May 1, 2009
1 parent 184ffa4 commit ce3c6c3
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/filesystems/sleuthkit/python/sk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,15 +1297,11 @@ skfile_read(skfile *self, PyObject *args, PyObject *kwds) {
// may need to start reading a bit ahead.
if(self->readptr > count * fs->block_size)
start += (self->readptr - count * fs->block_size);

/* do a direct block read from the filesystem */
blockbuf = tsk_data_buf_alloc(buf, overread);
len = tsk_fs_read_random(fs, blockbuf->data, to_read, start);
len = tsk_fs_read_random(fs, buf+written, to_read, start);
if(len > 0) {
memcpy(buf+written, blockbuf->data, len);
written += len;
written += len;
}
tsk_data_buf_free(blockbuf);
}

/*
Expand Down

0 comments on commit ce3c6c3

Please sign in to comment.