[gnome-shell] Change all g_memdup() to g_memdup2()
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Change all g_memdup() to g_memdup2()
- Date: Thu, 4 Feb 2021 19:53:06 +0000 (UTC)
commit 463000d04d51ff7f29b039d5ea97a7b36fdd7b57
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Thu Feb 4 18:56:02 2021 +0100
Change all g_memdup() to g_memdup2()
Using g_memdup() is dangerous due to the type of the size argument. See
https://gitlab.gnome.org/GNOME/glib/-/issues/2319 and
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1926 for details.
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1637>
.gitlab-ci.yml | 2 +-
src/st/st-private.c | 7 ++++---
2 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 03455eea05..db621b0730 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -29,7 +29,7 @@ variables:
LINT_LOG: "eslint-report.xml"
LINT_MR_LOG: "eslint-mr-report.xml"
-image: registry.gitlab.gnome.org/gnome/mutter/fedora/33:x86_64-2021-01-14.0
+image: registry.gitlab.gnome.org/gnome/mutter/fedora/33:x86_64-2021-02-04.1
workflow:
rules:
diff --git a/src/st/st-private.c b/src/st/st-private.c
index 2bdcf9b4b9..5bbefa7631 100644
--- a/src/st/st-private.c
+++ b/src/st/st-private.c
@@ -278,7 +278,7 @@ blur_pixels (guchar *pixels_in,
gdouble blur,
gint *width_out,
gint *height_out,
- gint *rowstride_out)
+ size_t *rowstride_out)
{
guchar *pixels_out;
gdouble sigma;
@@ -295,7 +295,7 @@ blur_pixels (guchar *pixels_in,
*width_out = width_in;
*height_out = height_in;
*rowstride_out = rowstride_in;
- pixels_out = g_memdup (pixels_in, *rowstride_out * *height_out);
+ pixels_out = g_memdup2 (pixels_in, *rowstride_out * *height_out);
}
else
{
@@ -593,7 +593,8 @@ _st_create_shadow_cairo_pattern (StShadow *shadow_spec_in,
cairo_pattern_t *dst_pattern;
guchar *pixels_in, *pixels_out;
gint width_in, height_in, rowstride_in;
- gint width_out, height_out, rowstride_out;
+ gint width_out, height_out;
+ size_t rowstride_out;
cairo_matrix_t shadow_matrix;
double xscale_in, yscale_in;
int i, j;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]