liblog: reject empty logging messages
A regression after "liblog: Instrument logging of logd write drops" where an empty payload would result in an insufficient iovec to report the write drop. Change-Id: Iffabcfbb0680898d7a42004700e638e9d940ff5f
This commit is contained in:
parent
928cbdd2c3
commit
31f7df5fd1
1 changed files with 4 additions and 0 deletions
|
@ -178,6 +178,10 @@ static int __write_to_log_daemon(log_id_t log_id, struct iovec *vec, size_t nr)
|
|||
static pid_t last_pid = (pid_t) -1;
|
||||
static atomic_int_fast32_t dropped;
|
||||
|
||||
if (!nr) {
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (last_uid == AID_ROOT) { /* have we called to get the UID yet? */
|
||||
last_uid = getuid();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue