intel / openlldp

Other
54 stars 43 forks source link

lldpad: fix using uninitialized value #102

Closed liuhangbin closed 4 months ago

liuhangbin commented 5 months ago

When the length is less than sizeof(cmd.ifname), the cmd.ifname will be printed uninitialized, which could cause information leakage. Fix this by copying the maximum size of ifname before printing it out.

This issue was found through static code analysis.

Fixes: a37b7e0f3b66 ("lldpad: initial git commit") Fixes: 3b559d8d0b52 ("VDP: vdptool first version")

liuhangbin commented 5 months ago

Instead, the printf() should probably be changed to print the source value from the memcpy for debug purposes

Thanks, the patch updated.

apconole commented 4 months ago

Merged - thanks!