* Added loglevel parameter to logg()
* Fix logg and mprintf internals with new loglevels
* Update all logg calls to set loglevel
* Update all mprintf calls to set loglevel
* Fix hidden logg calls
* Executed clam-format
Accidentally introduced an invalid format string character, which is
apparently just a warning. ¯\_(ツ)_/¯
But Coverity really didn't like it, and now that I know about it,
neither do I...
The mbox.c:messageGetFilename() function returns a COPY of the filename,
which must be free()'d.
Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=31775
Also fixed and issue where the email parser may fail to finish parsing
soem multipart emails when --gen-json is enabled if messageGetJObj() or
cli_json_addowner() fail. These should be non-fatal failures. The rest
of the (broken) email should be parsed.
The email parser (mbox.c & message.c) also has a lot of assertions
instead using if()'s for error handling.
Because of the complexity of the email parser, it's unclear for many of
the assertions if they could be triggered based on user input like
scanning a malformed email. So to be safe, I've replaced all of the
assertions in this parser with error handling to fail gracefully.
Also fix formatting issues and use `stdbool.h`'s `true` instead of `TRUE`.
Many of the core scanning functions' names no longer represent their
specific purpose or arguments. This commit aims to make the names more
intuitive. Names are now prefixed with "magic" if they involve
file-typing and file-type parsing. In addition, each function now
includes the type of input being scanned whether its "desc", "fmap", or
"buff". Some of the APIs also now specify "type" to indicate that a type
other than "ANY" may be passed in to select the type rather than use
file type magic for type recognition.
| current name | new name |
| ------------------------- | --------------------------------- |
| magic_scandesc() | cli_magic_scan() |
| cli_magic_scandesc_type() | <delete> |
| cli_magic_scandesc() | cli_magic_scan_desc() |
| cli_base_scandesc() | cli_magic_scan_desc_type() |
| cli_partition_scandesc() | <delete> |
| cli_map_scandesc() | magic_scan_nested_fmap_type() |
| cli_map_scan() | cli_magic_scan_nested_fmap_type() |
| cli_mem_scandesc() | cli_magic_scan_buff() |
| cli_scanbuff() | cli_scan_buff() |
| cli_scandesc() | cli_scan_desc() |
| cli_fmap_scandesc() | cli_scan_fmap() |
| cli_scanfile() | cli_magic_scan_file() |
| cli_scandir() | cli_magic_scan_dir() |
| cli_filetype2() | cli_determine_fmap_type() |
| cli_filetype() | cli_compare_ftm_file() |
| cli_partitiontype() | cli_compare_ftm_partition() |
| cli_scanraw() | scanraw() |
to #ifndef CL_DEBUG #define NDEBUG #endif in each .c file that uses assert.
If you want assertions enabled you'll need to use --enable-debug to configure,
as until now, no change there.
git-svn: trunk@4343