Fix overlapping g_snprintf().
This commit is contained in:
parent
a8e22e2e9d
commit
3aa4f29e60
39
audio/grip/patches/patch-src_discdb_c
Normal file
39
audio/grip/patches/patch-src_discdb_c
Normal file
@ -0,0 +1,39 @@
|
||||
$OpenBSD: patch-src_discdb_c,v 1.5 2014/12/04 08:28:25 landry Exp $
|
||||
overlapping snprintf
|
||||
--- src/discdb.c.orig Sat Jun 25 20:23:13 2005
|
||||
+++ src/discdb.c Thu Dec 4 09:21:33 2014
|
||||
@@ -607,9 +607,11 @@ gboolean DiscDBRead(DiscInfo *disc,DiscDBServer *serve
|
||||
|
||||
/* Both disc title and artist have been stuffed in the title field, so the
|
||||
need to be separated */
|
||||
-
|
||||
- DiscDBParseTitle(data->data_title,data->data_title,data->data_artist,"/");
|
||||
+ inbuffer=strdup(data->data_title);
|
||||
|
||||
+ DiscDBParseTitle(inbuffer,data->data_title,data->data_artist,"/");
|
||||
+
|
||||
+ free(inbuffer);
|
||||
free(result);
|
||||
|
||||
/* Don't allow the genre to be overwritten */
|
||||
@@ -663,6 +665,7 @@ int DiscDBReadDiscData(DiscInfo *disc,DiscData *ddata,
|
||||
FILE *discdb_data=NULL;
|
||||
int index,genre;
|
||||
char root_dir[256],file[256],inbuf[512];
|
||||
+ char* buf;
|
||||
struct stat st;
|
||||
|
||||
g_snprintf(root_dir,256,"%s/.cddb",getenv("HOME"));
|
||||
@@ -720,8 +723,11 @@ int DiscDBReadDiscData(DiscInfo *disc,DiscData *ddata,
|
||||
|
||||
/* Both disc title and artist have been stuffed in the title field, so the
|
||||
need to be separated */
|
||||
+ buf = strdup(ddata->data_title);
|
||||
|
||||
- DiscDBParseTitle(ddata->data_title,ddata->data_title,ddata->data_artist,"/");
|
||||
+ DiscDBParseTitle(buf,ddata->data_title,ddata->data_artist,"/");
|
||||
+
|
||||
+ free(buf);
|
||||
|
||||
if(!DiscDBUTF8Validate(disc,ddata)) {
|
||||
DiscDBConvertEncoding(disc,ddata,strcasecmp(encoding,"UTF-8")?
|
Loading…
Reference in New Issue
Block a user