[tracker] Ported bufferoverflow fix from tracker-0.6 branch
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [tracker] Ported bufferoverflow fix from tracker-0.6 branch
- Date: Thu, 6 Aug 2009 11:19:29 +0000 (UTC)
commit 441d064d87416dfff77b0516c1e34c8f67711041
Author: Philip Van Hoof <philip codeminded be>
Date: Thu Aug 6 13:18:50 2009 +0200
Ported bufferoverflow fix from tracker-0.6 branch
src/tracker-extract/tracker-extract-tiff.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-tiff.c b/src/tracker-extract/tracker-extract-tiff.c
index 02bd782..ac82428 100644
--- a/src/tracker-extract/tracker-extract-tiff.c
+++ b/src/tracker-extract/tracker-extract-tiff.c
@@ -404,28 +404,28 @@ extract_tiff (const gchar *uri,
continue;
}
- sprintf (buffer,"%s",text);
+ snprintf (buffer, sizeof (buffer), "%s",text);
break;
case TIFF_TAGTYPE_UINT16:
if (!TIFFGetField (image, tag->tag, &varui16)) {
continue;
}
- sprintf (buffer,"%i",varui16);
+ snprintf (buffer, sizeof (buffer), "%i",varui16);
break;
case TIFF_TAGTYPE_UINT32:
if (!TIFFGetField (image, tag->tag, &varui32)) {
continue;
}
- sprintf(buffer,"%i",varui32);
+ snprintf(buffer, sizeof (buffer), "%i",varui32);
break;
case TIFF_TAGTYPE_DOUBLE:
if (!TIFFGetField (image, tag->tag, &vardouble)) {
continue;
}
- sprintf (buffer,"%f",vardouble);
+ snprintf (buffer, sizeof (buffer), "%f",vardouble);
break;
case TIFF_TAGTYPE_C16_UINT16:
if (!TIFFGetField (image, tag->tag, &count16, &data)) {
@@ -433,7 +433,7 @@ extract_tiff (const gchar *uri,
}
/* We only take only the first for now */
- sprintf (buffer,"%i",*(guint16 *)data);
+ snprintf (buffer, sizeof (buffer), "%i",*(guint16 *)data);
break;
default:
@@ -469,28 +469,28 @@ extract_tiff (const gchar *uri,
continue;
}
- sprintf (buffer,"%s", text);
+ snprintf (buffer, sizeof (buffer), "%s", text);
break;
case TIFF_TAGTYPE_UINT16:
if (!TIFFGetField (image, tag->tag, &varui16)) {
continue;
}
- sprintf (buffer,"%i",varui16);
+ snprintf (buffer, sizeof (buffer), "%i",varui16);
break;
case TIFF_TAGTYPE_UINT32:
if (!TIFFGetField (image, tag->tag, &varui32)) {
continue;
}
- sprintf(buffer,"%i",varui32);
+ snprintf(buffer, sizeof (buffer), "%i",varui32);
break;
case TIFF_TAGTYPE_DOUBLE:
if (!TIFFGetField (image, tag->tag, &vardouble)) {
continue;
}
- sprintf (buffer,"%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]