changeset 458:89453f4a4278 trunk

[svn] Fixed possible buffer overflow.
author js
date Wed, 17 Jan 2007 10:49:17 -0800
parents f5ed9a6ad3f1
children cea6393eacc3
files ChangeLog src/wavpack/tags.h src/wavpack/ui.cxx
diffstat 3 files changed, 19 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Wed Jan 17 09:14:03 2007 -0800
+++ b/ChangeLog	Wed Jan 17 10:49:17 2007 -0800
@@ -1,3 +1,12 @@
+2007-01-17 17:14:03 +0000  Giacomo Lozito <james@develia.org>
+  revision [998]
+  - evdev-plug: added volume->mute and win->jumptofile actions
+  trunk/src/evdev-plug/ed.c         |   44 +++++++++++++++++++++++++++++++++++++-
+  trunk/src/evdev-plug/ed_actions.h |    4 ++-
+  trunk/src/evdev-plug/ed_ui.c      |    3 +-
+  3 files changed, 48 insertions(+), 3 deletions(-)
+
+
 2007-01-17 16:52:04 +0000  Giacomo Lozito <james@develia.org>
   revision [996]
   - status icon plugin: better logic for KWin workaround
--- a/src/wavpack/tags.h	Wed Jan 17 09:14:03 2007 -0800
+++ b/src/wavpack/tags.h	Wed Jan 17 10:49:17 2007 -0800
@@ -4,6 +4,7 @@
 #include <stdio.h>
 
 const int MAX_LEN = 2048;
+const int MAX_LEN = 128;
 const int TAG_NONE = 0;
 const int TAG_ID3 = 1;
 const int TAG_APE = 2;
@@ -14,8 +15,8 @@
     char    album           [MAX_LEN];
     char    comment         [MAX_LEN];
     char    genre           [MAX_LEN];
-    char    track           [128];
-    char    year            [128];
+    char    track           [MAX_LEN2];
+    char    year            [MAX_LEN2];
     int     _genre;
 } ape_tag;
 
--- a/src/wavpack/ui.cxx	Wed Jan 17 09:14:03 2007 -0800
+++ b/src/wavpack/ui.cxx	Wed Jan 17 10:49:17 2007 -0800
@@ -85,13 +85,13 @@
 {
     ape_tag Tag;
 
-    strcpy(Tag.title, gtk_entry_get_text(GTK_ENTRY(title_entry)));
-    strcpy(Tag.artist, gtk_entry_get_text(GTK_ENTRY(performer_entry)));
-    strcpy(Tag.album, gtk_entry_get_text(GTK_ENTRY(album_entry)));
-    strcpy(Tag.comment, gtk_entry_get_text(GTK_ENTRY(user_comment_entry)));
-    strcpy(Tag.track, gtk_entry_get_text(GTK_ENTRY(tracknumber_entry)));
-    strcpy(Tag.year, gtk_entry_get_text(GTK_ENTRY(date_entry)));
-    strcpy(Tag.genre, gtk_entry_get_text(GTK_ENTRY(genre_entry)));
+    strncpy(Tag.title, gtk_entry_get_text(GTK_ENTRY(title_entry)), MAX_LEN);
+    strncpy(Tag.artist, gtk_entry_get_text(GTK_ENTRY(performer_entry)), MAX_LEN);
+    strncpy(Tag.album, gtk_entry_get_text(GTK_ENTRY(album_entry)), MAX_LEN);
+    strncpy(Tag.comment, gtk_entry_get_text(GTK_ENTRY(user_comment_entry)), MAX_LEN);
+    strncpy(Tag.track, gtk_entry_get_text(GTK_ENTRY(tracknumber_entry)), MAX_LEN2);
+    strncpy(Tag.year, gtk_entry_get_text(GTK_ENTRY(date_entry)), MAX_LEN2);
+    strncpy(Tag.genre, gtk_entry_get_text(GTK_ENTRY(genre_entry)), MAX_LEN);
     WriteAPE2Tag(filename, &Tag);
     g_free(filename);
     gtk_widget_destroy(window);