return true;
}
- if (container->real_length == 0) {
- ws_info("blf_pull_logcontainer_into_memory: found container with 0 length");
- return true;
- }
-
/* pull compressed data into buffer */
if (container->infile_start_pos < 0) {
/*
return false;
}
+ if (container->real_length == 0) {
+ ws_info("blf_pull_logcontainer_into_memory: found container with 0 length");
+ /* Skip empty container */
+ if (!wtap_read_bytes_or_eof(params->fh, NULL, (unsigned int)data_length, err, err_info)) {
+ if (*err == WTAP_ERR_SHORT_READ) {
+ /*
+ * XXX - our caller will turn this into an EOF.
+ * How *should* it be treated?
+ * For now, we turn it into Yet Another Internal Error,
+ * pending having better documentation of the file
+ * format.
+ */
+ *err = WTAP_ERR_INTERNAL;
+ *err_info = ws_strdup("blf_pull_logcontainer_into_memory: short read on 0-length container");
+ }
+ return false;
+ }
+ return true;
+ }
+
if (container->compression_method == BLF_COMPRESSION_NONE) {
unsigned char* buf = g_try_malloc0((size_t)container->real_length);
if (buf == NULL) {