gphoto / libgphoto2

The libgphoto2 camera access and control library.
GNU Lesser General Public License v2.1
1.03k stars 324 forks source link

Fix string overflow in camera_summary #910

Closed paolodepetrillo closed 1 year ago

paolodepetrillo commented 1 year ago

This fixes a crash running "gphoto2 --summary" when there is a PTP property which is a very long array overflowing the buffer. It also truncates the long array - not sure if 64 is the appropriate value to truncate at.

The problem was triggered by this property from an Olympus E-M1 II:

Property 0xd405:(read only) (type=0x4002) a[74752] 0,0,1,0,5,0,0,0,0,0,1,0,32,0,223,222,0,0,86,0,0,0,48,48,0,0,1,0,32,0,168,37,0,0,53,223,0,0,32,32,0,0,1,0,32,0,168,16,0,0,221,4,1,0,24,24,0,0,1,0,32,0,136,9, ...