Skip to content

Use g_memdup2 instead of g_memdup

Yongha Hwang requested to merge MShrimp4/xfce4-settings:g_memdup2 into master

Related :

g_memdup() gets size argument as guint(32bit) instead of gsize(64bit), and may cause vulnerability. g_memdup2() fixes this problem and deprecated g_memdup() with its introduction. Although it is highly unlikely to happen for our usage, it would be better to use a safer approach.

Unfortunately g_memdup2() is introduced in 2.67.3 (this year), so would not be a good idea to assume the linux distribution supports one. This MR uses an inline version if it is not supported.

Merge request reports