From: Jan P. <pa...@pi...> - 2004-02-03 21:06:35
|
Hi, Thanks for finding this bug! It is now in CVS. --- Jan > exif kept on dumping core on me, so I decided to go searching for the > culprit and here it is (BTW: valgrind really rocks): > Index: exif/main.c > RCS file: /cvsroot/libexif/exif/exif/main.c,v > retrieving revision 1.37 > diff -u -r1.37 main.c > --- exif/main.c 30 Sep 2003 22:43:00 -0000 1.37 > +++ exif/main.c 28 Jan 2004 20:35:27 -0000 > @@ -109,7 +109,7 @@ > */ > if (e->format == EXIF_FORMAT_ASCII) { > if (e->data) free (e->data); > - e->components = strlen (e->data) + 1; > + e->components = strlen (set_value) + 1; > e->size = strlen (set_value) + 1; > e->data = malloc (sizeof (char) * e->size); > if (!e->data) { > > What a trivial bug, but so hard to find. > > And before I forget: Thanks for libexif. > > Ah, and another remark: sizeof (char) =3D=3D 1. Always. Thats guaranteed > by the standard. That libexif (and most probably 90% of the existing > software which reads/writes binary data from/to files etc.) would stop > working with a char size of more then 8 bit is quite obvious. |