libgsf r1007 - in trunk: . gsf
- From: mortenw svn gnome org
- To: svn-commits-list gnome org
- Subject: libgsf r1007 - in trunk: . gsf
- Date: Thu, 25 Sep 2008 00:10:53 +0000 (UTC)
Author: mortenw
Date: Thu Sep 25 00:10:52 2008
New Revision: 1007
URL: http://svn.gnome.org/viewvc/libgsf?rev=1007&view=rev
Log:
2008-09-24 Morten Welinder <terra gnome org>
* gsf/gsf-infile-tar.c (unpack_octal): Add error check. Fixes
#553655.
Modified:
trunk/ChangeLog
trunk/gsf/gsf-infile-tar.c
Modified: trunk/gsf/gsf-infile-tar.c
==============================================================================
--- trunk/gsf/gsf-infile-tar.c (original)
+++ trunk/gsf/gsf-infile-tar.c Thu Sep 25 00:10:52 2008
@@ -96,7 +96,7 @@
#define GSF_IS_INFILE_TAR_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), GSF_INFILE_TAR_TYPE))
static gsf_off_t
-unpack_octal (const char *s, size_t len)
+unpack_octal (GsfInfileTar *tar, const char *s, size_t len)
{
gsf_off_t res = 0;
@@ -104,6 +104,11 @@
unsigned char c = *s++;
if (c == 0)
break;
+ if (c < '0' || c > '7') {
+ tar->err = g_error_new (gsf_input_error_id (), 0,
+ "Invalid tar header");
+ return 0;
+ }
res = (res << 3) + (c - '0');
}
@@ -219,7 +224,7 @@
pending_longname = NULL;
} else
name = g_strndup (header->name, sizeof (header->name));
- length = unpack_octal (header->size, sizeof (header->size));
+ length = unpack_octal (tar, header->size, sizeof (header->size));
offset = gsf_input_tell (tar->source);
#if 0
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]