Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bbd056ac authored by Yangster-mac's avatar Yangster-mac Committed by Yang Lu
Browse files

Fix the crash when parsing empty config.

Test: statsd test passed.
Change-Id: Ice4bcb7368ba416a9ffe6e9c89129b307302980e
parent 4953824b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -725,7 +725,7 @@ Status StatsService::addConfiguration(int64_t key,
    if (checkCallingPermission(String16(kPermissionDump))) {
        ConfigKey configKey(ipc->getCallingUid(), key);
        StatsdConfig cfg;
        if (!cfg.ParseFromArray(&config[0], config.size())) {
        if (config.empty() || !cfg.ParseFromArray(&config[0], config.size())) {
            *success = false;
            return Status::ok();
        }