Re: [RFC PATCH v3 19/28] hw/virtio: Replace g_memdup() by g_memdup2()

2022-04-01 Thread Eugenio Perez Martin
On Fri, Sep 3, 2021 at 8:11 PM 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. This >

[RFC PATCH v3 19/28] hw/virtio: 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