Escape invalid UTF8 characters simon987/sist2#44, increase magic buffer size

This commit is contained in:
2020-05-12 19:28:02 -04:00
parent 013423424e
commit cf513b4ad8
14 changed files with 528 additions and 385 deletions

View File

@@ -49,7 +49,6 @@ void parse(void *arg) {
return;
}
doc.filepath = job->filepath;
doc.ext = (short) job->ext;
doc.base = (short) job->base;
@@ -61,7 +60,7 @@ void parse(void *arg) {
doc.mtime = job->vfile.info.st_mtim.tv_sec;
uuid_generate(doc.uuid);
char *buf[PARSE_BUF_SIZE];
char *buf[MAGIC_BUF_SIZE];
if (LogCtx.very_verbose) {
char uuid_str[UUID_STR_LEN];
@@ -79,7 +78,7 @@ void parse(void *arg) {
if (doc.mime == 0 && !ScanCtx.fast) {
// Get mime type with libmagic
bytes_read = job->vfile.read(&job->vfile, buf, PARSE_BUF_SIZE);
bytes_read = job->vfile.read(&job->vfile, buf, MAGIC_BUF_SIZE);
if (bytes_read < 0) {
if (job->vfile.is_fs_file) {