[gegl] avoid buffer overflow in gegl_buffer_header_init()
- From: Nils Philippsen <nphilipp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] avoid buffer overflow in gegl_buffer_header_init()
- Date: Mon, 19 Apr 2010 10:45:30 +0000 (UTC)
commit e287b94c8cb078db86d883395bd089002b405e18
Author: Nils Philippsen <nils redhat com>
Date: Wed Feb 17 11:40:31 2010 +0100
avoid buffer overflow in gegl_buffer_header_init()
Use memcpy() instead of strcpy() as the target is not a zero-terminated
string.
gegl/buffer/gegl-buffer-save.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gegl/buffer/gegl-buffer-save.c b/gegl/buffer/gegl-buffer-save.c
index 85c7894..aff175c 100644
--- a/gegl/buffer/gegl-buffer-save.c
+++ b/gegl/buffer/gegl-buffer-save.c
@@ -196,7 +196,7 @@ gegl_buffer_header_init (GeglBufferHeader *header,
gint bpp,
Babl* format)
{
- strcpy (header->magic, "GEGL");
+ memcpy (header->magic, "GEGL", 4);
header->flags = GEGL_FLAG_HEADER;
header->tile_width = tile_width;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]