From: Bencheng Jing Date: Tue, 3 Jul 2018 13:31:21 +0000 (+0800) Subject: vlock: fix hdmi crash X-Git-Tag: khadas-vims-v0.9.6-release~1754 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2d2870dd3f2063db22a41a3bbf3684aaac7258e8;p=platform%2Fkernel%2Flinux-amlogic.git vlock: fix hdmi crash PD#169483: vlock: fix hdmi crash Change-Id: I0f2770f65789430f096e16637ba5b542bd670b16 Signed-off-by: Bencheng Jing --- diff --git a/drivers/amlogic/media/enhancement/amvecm/vlock.c b/drivers/amlogic/media/enhancement/amvecm/vlock.c index 17c6abb..a01bbe7 100644 --- a/drivers/amlogic/media/enhancement/amvecm/vlock.c +++ b/drivers/amlogic/media/enhancement/amvecm/vlock.c @@ -390,10 +390,8 @@ void vlock_vmode_check(void) vinfo = get_current_vinfo(); vlock_vmode_changed = 0; memset(cur_vout_mode, 0, sizeof(cur_vout_mode)); - - if (vinfo->name == NULL) - return; - if (strlen(cur_vout_mode) < (strlen(vinfo->name)+1)) + if ((vinfo->name == NULL) || + (strlen(vinfo->name) > sizeof(cur_vout_mode))) return; strcpy(cur_vout_mode, vinfo->name);