qemu-edid: Restrict input parameter -d to avoid division by zero
PATCH 1/1 qemu-edid: Restrict input parameter -d to avoid division by zero
A zero value for dpi will lead to a division by zero in qemu_edid_dpi_to_mm(). Tested by runnig qemu-edid -dX, X = 0, 100.
Resolves: qemu-project/qemu#1249
Suggested-by Thomas Huth <[email protected]>
Signed-off-by Sebastian Mitterle <[email protected]>
--- qemu-edid.c | 4 ++++ 1 file changed, 4 insertions(+)
qemu-edid.c +4 -0
@@ -92,6 +92,10 @@ int main(int argc, char *argv[])fprintf (stderr,"not a number: %s\n" , optarg);exit (1 ); } +if (dpi ==0 ) { +fprintf (stderr,"cannot be zero: %s\n" , optarg); +exit (1 ); + }break ;case 'v' : info.vendor = optarg;
Signature · 1 line
2.37.3
Quoted 7 lines · Sebastian Mitterle
A zero value for dpi will lead to a division by zero in
qemu_edid_dpi_to_mm(). Tested by runnig qemu-edid -dX, X = 0, 100.Resolves: qemu-project/qemu#1249
Suggested-by Thomas Huth <[email protected]>Signed-off-by Sebastian Mitterle <[email protected]>
Added to queue.
thanks,
Gerd