rpms/grip/EL-5 grip.split-utf-8-strings.patch, NONE, 1.1 grip.spec, 1.19, 1.20
Adrian Reber
adrian at fedoraproject.org
Tue Nov 11 08:11:30 UTC 2008
- Previous message: rpms/pdf2djvu/F-9 import.log, NONE, 1.1 pdf2djvu-strerror.patch, NONE, 1.1 pdf2djvu.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Next message: rpms/autofs/devel autofs.spec,1.258,1.259
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: adrian
Update of /cvs/extras/rpms/grip/EL-5
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv22990
Modified Files:
grip.spec
Added Files:
grip.split-utf-8-strings.patch
Log Message:
* Mon Nov 10 2008 Adrian Reber <adrian at lisas.de> - 1:3.2.0-25
- fixed "grip breaks utf-8 sequences up when writing xmcd CD database file"
(#466656)
grip.split-utf-8-strings.patch:
--- NEW FILE grip.split-utf-8-strings.patch ---
diff --git a/src/discdb.c b/src/discdb.c
index c21a608..49d6475 100644
--- a/src/discdb.c
+++ b/src/discdb.c
@@ -684,34 +684,70 @@ int DiscDBReadDiscData(DiscInfo *disc,DiscData *ddata)
return 0;
}
+static void print_header(char *header,int num,FILE *outfile)
+{
+ if(num==-1)
+ fprintf(outfile,"%s=",header);
+ else
+ fprintf(outfile,"%s%d=",header,num);
+}
+
static void DiscDBWriteLine(char *header,int num,char *data,FILE *outfile,
char *encoding)
{
int len;
- char *offset;
+ int tmp;
if(strcasecmp(encoding,"utf-8")) {
StrConvertEncoding(data,"utf-8",encoding,512);
}
len=strlen(data);
- offset=data;
for(;;) {
- if(len>70) {
- if(num==-1)
- fprintf(outfile,"%s=%.70s\n",header,offset);
- else fprintf(outfile,"%s%d=%.70s\n",header,num,offset);
-
- offset+=70;
- len-=70;
- }
- else {
- if(num==-1) fprintf(outfile,"%s=%s\n",header,offset);
- else fprintf(outfile,"%s%d=%s\n",header,num,offset);
- break;
+ tmp=0;
+ print_header(header,num,outfile);
+ if(len<=0)
+ goto end;
+ for(;;) {
+ tmp++;
+ fprintf(outfile,"%c",*data);
+ if(--len<=0)
+ goto end;
+ data++;
+ if(tmp>65) {
+ /* check if starting from the 65 character a
+ * UTF-8 multibyte character is present
+ * according to wikipedia
+ * 0x80-0xBF Second, third, or fourth byte of a multi-byte sequence
+ * 0xC0-0xC1 Overlong encoding: start of a 2-byte sequence,
+ * but code point <= 127
+ * 0xC2-0xDF Start of 2-byte sequence
+ * 0xE0-0xEF Start of 3-byte sequence
+ * 0xF0-0xF4 Start of 4-byte sequence
+ *
+ * so to test if it is < 0x80 seems good enough */
+ if((*(data-1) & 0xFF) < 0x80) {
+ /* no UTF-8 char; then it is time for a new line */
+ fprintf(outfile,"\n");
+ break;
+ }
+ /* let's see if the next character is the starting of a
+ * 2/3/4-byte sequence; if yes we print now also a new-line;
+ * all this can only be done if the next character actually exists */
+ if(len>0) {
+ if(((*data & 0xFF) >= 0xC2) && ((*data & 0xFF) <= 0xF4)) {
+ fprintf(outfile,"\n");
+ break;
+ }
+ }
+ }
}
}
+
+end:
+ if(len<=0)
+ fprintf(outfile,"\n");
}
Index: grip.spec
===================================================================
RCS file: /cvs/extras/rpms/grip/EL-5/grip.spec,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- grip.spec 9 Nov 2008 15:08:41 -0000 1.19
+++ grip.spec 11 Nov 2008 08:10:59 -0000 1.20
@@ -1,7 +1,7 @@
Summary: Front-end for CD rippers and Ogg Vorbis encoders
Name: grip
Version: 3.2.0
-Release: 24%{?dist}
+Release: 25%{?dist}
Epoch: 1
License: GPLv2+
Group: Applications/Multimedia
@@ -14,6 +14,7 @@
Patch5: grip-3.2.0-lookup.patch
Patch6: grip-3.2.0-executionpatch.patch
Patch7: grip.834724.patch
+Patch8: grip.split-utf-8-strings.patch
URL: http://www.nostatic.org/grip/
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: vorbis-tools
@@ -37,6 +38,7 @@
%patch5 -p1
%patch6 -p1
%patch7 -p1
+%patch8 -p1
%build
@@ -98,6 +100,10 @@
%{_mandir}/man1/*
%changelog
+* Mon Nov 10 2008 Adrian Reber <adrian at lisas.de> - 1:3.2.0-25
+- fixed "grip breaks utf-8 sequences up when writing xmcd CD database file"
+ (#466656)
+
* Sun Nov 09 2008 Adrian Reber <adrian at lisas.de> - 1:3.2.0-24
- fixed "buffer overflow caused by large amount of CDDB replies" (#470552)
(CVE-2005-0706)
- Previous message: rpms/pdf2djvu/F-9 import.log, NONE, 1.1 pdf2djvu-strerror.patch, NONE, 1.1 pdf2djvu.spec, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
- Next message: rpms/autofs/devel autofs.spec,1.258,1.259
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list