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

Commit bea60239 authored by Steve Kondik's avatar Steve Kondik Committed by Arne Coucheron
Browse files

camera: Don't segfault if we get a NULL parameter

 * Values end up NULL on some drivers, don't crash.

Change-Id: Ic897dbd4629cf3af98c85f93be202c382dde806b
parent 6cc7a9a5
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -237,6 +237,9 @@ void CameraParameters::unflatten(const String8 &params)


void CameraParameters::set(const char *key, const char *value)
void CameraParameters::set(const char *key, const char *value)
{
{
    if (key == NULL || value == NULL)
        return;

    // XXX i think i can do this with strspn()
    // XXX i think i can do this with strspn()
    if (strchr(key, '=') || strchr(key, ';')) {
    if (strchr(key, '=') || strchr(key, ';')) {
        //XXX ALOGE("Key \"%s\"contains invalid character (= or ;)", key);
        //XXX ALOGE("Key \"%s\"contains invalid character (= or ;)", key);