Re: [PATCH v3 05/28] block/qcow2-bitmap: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
On 9/3/21 11:13 PM, Eric Blake wrote: > On Fri, Sep 03, 2021 at 07:44:47PM +0200, Philippe Mathieu-Daudé wrote: >> Per >> https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 >> >> The old API took the size of the memory to duplicate as a guint, >> whereas most me

Re: [PATCH v3 05/28] block/qcow2-bitmap: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Eric Blake
On Fri, Sep 03, 2021 at 07:44:47PM +0200, Philippe Mathieu-Daudé wrote: > Per > https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 > > The old API took the size of the memory to duplicate as a guint, > whereas most memory functions take memory sizes as a gsize.

[PATCH v3 05/28] block/qcow2-bitmap: Replace g_memdup() by g_memdup2()

2021-09-03 Thread Philippe Mathieu-Daudé
Per https://discourse.gnome.org/t/port-your-module-from-g-memdup-to-g-memdup2-now/5538 The old API took the size of the memory to duplicate as a guint, whereas most memory functions take memory sizes as a gsize. This made it easy to accidentally pass a gsize to g_memdup(). For large value