lcd: avoid possible NULL dereference
PATCH 1/1 lcd: avoid possible NULL dereference
Do not dereference bmp before the check if it is NULL.
The problem was indicated by cppcheck.
--- common/lcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
common/lcd.c +2 -1
@@ -578,7 +578,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)unsigned long pwidth = panel_info.vl_col;unsigned colors, bpix, bmp_bpix;int hdr_size; -struct bmp_color_table_entry *palette = bmp->color_table; +struct bmp_color_table_entry *palette;if (!bmp || !(bmp->header.signature[0 ] =='B' && bmp->header.signature[1 ] =='M' )) {
@@ -587,6 +587,7 @@ int lcd_display_bitmap(ulong bmp_image, int x, int y)return 1 ; } + palette = bmp->color_table; width =get_unaligned_le32 (&bmp->header.width); height =get_unaligned_le32 (&bmp->header.height); bmp_bpix =get_unaligned_le16 (&bmp->header.bit_count);
Signature · 1 line
2.13.2
PATCH 1/1 lcd: avoid possible NULL dereference
Quoted 8 lines · Heinrich Schuchardt
Do not dereference bmp before the check if it is NULL.
The problem was indicated by cppcheck.
Signed-off-by Heinrich Schuchardt <[email protected]>--- common/lcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
PATCH 1/1 lcd: avoid possible NULL dereference
In reply to Heinrich SchuchardtQuoted 8 lines · Heinrich Schuchardt
Do not dereference bmp before the check if it is NULL.
The problem was indicated by cppcheck.
Signed-off-by Heinrich Schuchardt <[email protected]>
PATCH 1/1 lcd: avoid possible NULL dereference
Quoted 12 lines · Dr. Philipp Tomsich
Quoted 8 lines · Heinrich Schuchardt
Do not dereference bmp before the check if it is NULL.
The problem was indicated by cppcheck.
Signed-off-by Heinrich Schuchardt <[email protected]>Reviewed-by Philipp Tomsich <[email protected]>
Hello Tom,
the patch
https://patchwork.ozlabs.org/patch/795425/
has received positive reviews both by Philipp and by Simon.
Could you, please, consider merging it.
Best regards
Heinrich
PATCH 1/1 lcd: avoid possible NULL dereference
In reply to Heinrich SchuchardtHi,
Quoted 8 lines · On Sun, 30 Jul 2017 21:59:23 +0200 Heinrich Schuchardt xypron.glpk at gmx.de…
Do not dereference bmp before the check if it is NULL.
The problem was indicated by cppcheck.
Signed-off-by Heinrich Schuchardt <[email protected]>--- common/lcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Applied to u-boot-video/master, thanks!
--
Anatolij
PATCH 1/1 lcd: avoid possible NULL dereference - Please update MAINTAINERS
Quoted 14 lines · Anatolij Gustschin
Hi,
Quoted 8 lines · On Sun, 30 Jul 2017 21:59:23 +0200 Heinrich Schuchardt xypron.glpk at gmx.de…
Do not dereference bmp before the check if it is NULL.
The problem was indicated by cppcheck.
Signed-off-by Heinrich Schuchardt <[email protected]>--- common/lcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
Quoted 5 lines
Applied to u-boot-video/master, thanks!
--
Anatolij
Hello Anatolij,
thank you for applying the patch.
To clarify the responsibilities could you, please, update your entry in MAINTAINERS to include
common/lcd*.cinclude/lcd*.h
and any other files you care for.
The current entry is:
VIDEO
M: Anatolij Gustschin <[email protected]> S: Maintained T: git git://git.denx.de/u-boot-video.git F: drivers/video/
Best regards
Heinrich
PATCH 1/1 lcd: avoid possible NULL dereference - Please update MAINTAINERS
Hello Heinrich,
On Sun, 20 Aug 2017 10:32:03 +0200
Heinrich Schuchardt xypron.glpk at gmx.de wrote:
...
Quoted 5 lines
To clarify the responsibilities could you, please, update your entry in
MAINTAINERSto include
common/lcd*.cinclude/lcd*.h
I've send a patch.
Thanks,
Anatolij
PATCH 1/1 lcd: avoid possible NULL dereference - Please update MAINTAINERS
In reply to Heinrich SchuchardtHello Heinrich,
On Sun, 20 Aug 2017 10:32:03 +0200
Heinrich Schuchardt xypron.glpk at gmx.de wrote:
...
Quoted 5 lines
To clarify the responsibilities could you, please, update your entry in
MAINTAINERSto include
common/lcd*.cinclude/lcd*.h
I've sent a patch.
Thanks,
Anatolij