From: Dan F. <dfa...@us...> - 2010-10-07 04:27:35
|
Update of /cvsroot/libexif/libexif-testsuite/tests In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18018/tests Modified Files: Makefile.am check-bid37022.sh Added Files: check-init-mandatory-tags.sh check-write-fail.sh Log Message: Added check-init-mandatory-tags.sh and check-write-fail.sh --- NEW FILE: check-init-mandatory-tags.sh --- #!/bin/sh # Ensure that all mandatory tags can be created with --set-value # TODO: add the other mandatory values for all image types . check-vars.sh dstimg="init.out.jpg" srcimg="$SRCDIR/images/no-exif.jpg" check_result () { s="$?" if test "$s" -ne 0; then echo " FAILED (${s})." error=1 fi } # IFD 0 mandatory entries echo Create XResolution $EXIFEXE --create-exif --no-fixup --ifd=0 --tag=XResolution --set-value=' 99 1' -o "$dstimg" "$srcimg" >/dev/null check_result echo Create YResolution $EXIFEXE --create-exif --no-fixup --ifd=0 --tag=YResolution --set-value='123 2' -o "$dstimg" "$srcimg" >/dev/null check_result echo Create ResolutionUnit $EXIFEXE --create-exif --no-fixup --ifd=0 --tag=ResolutionUnit --set-value='3' -o "$dstimg" "$srcimg" >/dev/null check_result echo Create DateTime $EXIFEXE --create-exif --no-fixup --ifd=0 --tag=DateTime --set-value='2010:01:22 03:44:55' -o "$dstimg" "$srcimg" >/dev/null check_result echo Create YCbCrPositioning $EXIFEXE --create-exif --no-fixup --ifd=0 --tag=YCbCrPositioning --set-value='2' -o "$dstimg" "$srcimg" >/dev/null check_result # IFD EXIF mandatory entries echo Create ExifVersion $EXIFEXE --create-exif --no-fixup --ifd=EXIF --tag=ExifVersion --set-value='48 50 50 49' -o "$dstimg" "$srcimg" >/dev/null check_result echo Create ComponentsConfiguration $EXIFEXE --create-exif --no-fixup --ifd=EXIF --tag=ComponentsConfiguration --set-value='2 3 1 0' -o "$dstimg" "$srcimg" >/dev/null check_result echo Create FlashPixVersion $EXIFEXE --create-exif --no-fixup --ifd=EXIF --tag=FlashPixVersion --set-value='48 49 48 48' -o "$dstimg" "$srcimg" >/dev/null check_result echo Create ColorSpace $EXIFEXE --create-exif --no-fixup --ifd=EXIF --tag=ColorSpace --set-value='2' -o "$dstimg" "$srcimg" >/dev/null check_result echo Create PixelXDimension $EXIFEXE --create-exif --no-fixup --ifd=EXIF --tag=PixelXDimension --set-value='64' -o "$dstimg" "$srcimg" >/dev/null check_result echo Create PixelYDimension $EXIFEXE --create-exif --no-fixup --ifd=EXIF --tag=PixelYDimension --set-value='32' -o "$dstimg" "$srcimg" >/dev/null check_result rm "$dstimg" exit 0 Here are the default values created by exif for the mandatory tags which for which it is able to create default values. EXIF tags in '(EXIF)' ('Motorola' byte order): ------+------------------------------------------------------------------------ Tag |Value ------+------------------------------------------------------------------------ 0x011a|72.00 0x011b|72.00 0x0128|Inch 0x0213|Centred 0x0132|2010:09:25 23:58:21 0x9000|Exif Version 2.1 0x9101|Y Cb Cr - 0xa000|FlashPix Version 1.0 0xa001|Uncalibrated 0xa002|0 0xa003|0 ------+------------------------------------------------------------------------ EXIF tags in '(EXIF)': 0 1 EXIF GPS Interop 0x011a X-Resolution * - - - - 0x011b Y-Resolution * - - - - 0x0128 Resolution Unit * - - - - 0x0132 Date and Time * - - - - 0x0213 YCbCr Positioning * - - - - 0x9000 Exif Version - - * - - 0x9101 Components Configuration - - * - - 0xa000 FlashPixVersion - - * - - 0xa001 Colour Space - - * - - 0xa002 Pixel X Dimension - - * - - 0xa003 Pixel Y Dimension - - * - - Index: check-bid37022.sh =================================================================== RCS file: /cvsroot/libexif/libexif-testsuite/tests/check-bid37022.sh,v retrieving revision 1.1 retrieving revision 1.2 diff -u -p -d -r1.1 -r1.2 --- check-bid37022.sh 16 Nov 2009 22:49:31 -0000 1.1 +++ check-bid37022.sh 7 Oct 2010 04:27:27 -0000 1.2 @@ -1,9 +1,10 @@ #!/bin/sh -# Checks that libexif doesn't crash when reading a invalid image with a BYTE +# Checks that libexif doesn't crash when reading an invalid image with a BYTE # array that is fixed up to SHORT. libexif 0.6.18 overflowed the heap in # that case. This isn't a complete test because a heap overflow won't # always cause a crash, but a malloc library which checks heap consistency -# should catch it (such as glibc does when linked with -lmcheck). +# should catch it (such as glibc does when linked with -lmcheck, or valgrind). +# This bug is also known as CVE-2009-3895 . check-vars.sh bug="bid37022" srcimg="$SRCDIR/${bug}.jpg" Index: Makefile.am =================================================================== RCS file: /cvsroot/libexif/libexif-testsuite/tests/Makefile.am,v retrieving revision 1.31 retrieving revision 1.32 diff -u -p -d -r1.31 -r1.32 --- Makefile.am 17 Dec 2009 08:15:31 -0000 1.31 +++ Makefile.am 7 Oct 2010 04:27:27 -0000 1.32 @@ -28,7 +28,9 @@ EXTRA_DIST = \ check-add-tags.sh \ check-create-tags.sh \ check-fixup.sh \ - check-remove-tags.sh + check-remove-tags.sh \ + check-init-mandatory-tags.sh \ + check-write-fail.sh if HAVE_EXIF_CLI @@ -44,7 +46,9 @@ check_SCRIPTS = \ check-add-tags.sh \ check-create-tags.sh \ check-fixup.sh \ - check-remove-tags.sh + check-remove-tags.sh \ + check-init-mandatory-tags.sh \ + check-write-fail.sh # These check scripts may take a little longer - but are invaluable. :) check_SCRIPTS += check-general-images.sh \ --- NEW FILE: check-write-fail.sh --- #!/bin/sh # Check that exif properly detects an unwritable file . check-vars.sh tmpfile="./output.tmp" # Run this in the C locale so the messages are known export LANG=C export LANGUAGE=C failed="0" touch "$tmpfile" chmod 444 "$tmpfile" $EXIFEXE --create-exif --extract-thumbnail -o "$tmpfile" "$SRCDIR/images/canon-powershot-g2-001.jpg" test $? -eq 1 || exit 1 s="$?" rm -f "$tmpfile" exit "$s" |