Change-Id: Ibdc31f97dd0fd541b4f49f3eea89f8d5888f3737
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
struct pipe_logger_entry *const ple = (struct pipe_logger_entry *const)wr->buffer;
while ((wr->readed >= sizeof(ple->len)) && (ple->len <= wr->readed)) {
const int payload_size = ple->len - sizeof *ple;
- if (payload_size < 0 || payload_size > LOG_MAX_PAYLOAD_SIZE)
+ if (payload_size <= 0 || payload_size > LOG_MAX_PAYLOAD_SIZE)
return -EINVAL;
struct dlogutil_entry_with_msg lem;
{
size_t payload_size = msg_size - sizeof *ple;
assert(payload_size <= LOG_MAX_PAYLOAD_SIZE);
+ assert(payload_size > 0);
SHARED_PROCESS_MESSAGE(ple);
CHECK_PARAM(entry);
CHECK_PARAM(tag);
- if (entry->len - (int) sizeof(dlogutil_entry_s) < 2
+ if (entry->len > LOG_MAX_PAYLOAD_SIZE
+ || entry->len - (int) sizeof(dlogutil_entry_s) < 2
|| ((const char *)entry)[entry->len - 1] != '\0') {
*tag = NULL;
return TIZEN_ERROR_NO_DATA;
CHECK_PARAM(entry);
CHECK_PARAM(msg);
- if (entry->len - (int) sizeof(dlogutil_entry_s) < 2
+ if (entry->len > LOG_MAX_PAYLOAD_SIZE
+ || entry->len - (int) sizeof(dlogutil_entry_s) < 2
|| ((const char *)entry)[entry->len - 1] != '\0') {
*msg = NULL;
return TIZEN_ERROR_NO_DATA;