[tracker/tracker-0.6] Fixed NB#131222, Bufferoverflow fix (tracker-extract crashed on a TIFF)
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.6] Fixed NB#131222, Bufferoverflow fix (tracker-extract crashed on a TIFF)
- Date: Thu, 6 Aug 2009 11:16:02 +0000 (UTC)
commit 755fc8854d1bc0b105942e41d3ded1ea31ce5a5b
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Aug 6 13:14:19 2009 +0200
Fixed NB#131222, Bufferoverflow fix (tracker-extract crashed on a TIFF)
src/tracker-extract/tracker-extract-tiff.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-tiff.c b/src/tracker-extract/tracker-extract-tiff.c
index b5c1144..747cfa2 100644
--- a/src/tracker-extract/tracker-extract-tiff.c
+++ b/src/tracker-extract/tracker-extract-tiff.c
@@ -223,28 +223,28 @@ extract_tiff (const gchar *filename,
continue;
}
- snprintf (buffer, 1024, "%s",text);
+ snprintf (buffer, sizeof (buffer), "%s",text);
break;
case TIFF_TAGTYPE_UINT16:
if (!TIFFGetField (image, tag->tag, &varui16)) {
continue;
}
- snprintf (buffer, 1024, "%i",varui16);
+ snprintf (buffer, sizeof (buffer), "%i",varui16);
break;
case TIFF_TAGTYPE_UINT32:
if (!TIFFGetField (image, tag->tag, &varui32)) {
continue;
}
- snprintf(buffer, 1024, "%i",varui32);
+ snprintf(buffer, sizeof (buffer), "%i",varui32);
break;
case TIFF_TAGTYPE_DOUBLE:
if (!TIFFGetField (image, tag->tag, &vardouble)) {
continue;
}
- snprintf (buffer, 1024, "%f",vardouble);
+ snprintf (buffer, sizeof (buffer), "%f",vardouble);
break;
case TIFF_TAGTYPE_C16_UINT16:
if (!TIFFGetField (image, tag->tag, &count16, &data)) {
@@ -252,7 +252,7 @@ extract_tiff (const gchar *filename,
}
/* We only take only the first for now */
- snprintf (buffer, 1024, "%i",*(guint16 *)data);
+ snprintf (buffer, sizeof (buffer), "%i",*(guint16 *)data);
break;
default:
@@ -275,10 +275,8 @@ extract_tiff (const gchar *filename,
}
}
- int tel=0;
/* We want to give native tags priority over XMP/Exif */
for (tag = tags; tag->name; ++tag) {
- tel++;
switch (tag->type) {
case TIFF_TAGTYPE_STRING:
@@ -286,28 +284,28 @@ extract_tiff (const gchar *filename,
continue;
}
- snprintf (buffer, 1024, "%s", text);
+ snprintf (buffer, sizeof (buffer), "%s", text);
break;
case TIFF_TAGTYPE_UINT16:
if (!TIFFGetField (image, tag->tag, &varui16)) {
continue;
}
- snprintf (buffer, 1024, "%i",varui16);
+ snprintf (buffer, sizeof (buffer), "%i",varui16);
break;
case TIFF_TAGTYPE_UINT32:
if (!TIFFGetField (image, tag->tag, &varui32)) {
continue;
}
- snprintf(buffer, 1024, "%i",varui32);
+ snprintf(buffer, sizeof (buffer), "%i",varui32);
break;
case TIFF_TAGTYPE_DOUBLE:
if (!TIFFGetField (image, tag->tag, &vardouble)) {
continue;
}
- snprintf (buffer, 1024, "%f",vardouble);
+ snprintf (buffer, sizeof (buffer), "%f",vardouble);
break;
default:
continue;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]