diff --git a/bindings/java/Makefile.am b/bindings/java/Makefile.am index 0d5bb7777a3039ef75eb18688a436e090b899575..9bb1c374a9f0c62a0f5ca66923c45b1fcf2630f3 100644 --- a/bindings/java/Makefile.am +++ b/bindings/java/Makefile.am @@ -1,7 +1,7 @@ # Compile the sub directories SUBDIRS = jni -tsk_jar = $(top_builddir)/bindings/java/dist/Tsk_DataModel.jar +tsk_jar = $(top_builddir)/bindings/java/dist/sleuthkit-$(PACKAGE_VERSION).jar jardir = $(prefix)/share/java jar_DATA = $(tsk_jar) diff --git a/bindings/java/build.xml b/bindings/java/build.xml index 8fb0673544fa5c33fa034a1980284e93c53d3252..f4b9c9fe4f6776b6ca7bb66df6256e2e46a0ba81 100755 --- a/bindings/java/build.xml +++ b/bindings/java/build.xml @@ -12,6 +12,7 @@ <!-- set global properties for this build --> <property name="src" location="src/org/sleuthkit/datamodel"/> + <property name="VERSION" value="4.6.0"/> <property name="sample" location="src/org/sleuthkit/datamodel/Examples"/> <property name="build" location="build/"/> <property name="build-datamodel" location="build/org/sleuthkit/datamodel"/> @@ -129,17 +130,17 @@ <target name="dist-SQLite" depends="check-build, init-ivy, compile, copyLibs-SQLite" unless="up-to-date" description="generate the distribution" > <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> - <jar jarfile="${dist}/Tsk_DataModel.jar" basedir="${build}"/> + <jar jarfile="${dist}/sleuthkit-${VERSION}.jar" basedir="${build}"/> </target> <target name="dist-PostgreSQL" depends="check-build, init-ivy, compile, copyLibs-PostgreSQL" unless="up-to-date" description="generate the PostgreSQL distribution" > <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> - <jar jarfile="${dist}/Tsk_DataModel_PostgreSQL.jar" basedir="${build}"/> + <jar jarfile="${dist}/sleuthkit-postgresql-${VERSION}.jar" basedir="${build}"/> </target> <target name="check-build" depends="check-native-build"> - <uptodate property="java-up-to-date" targetfile="${dist}/Tsk_DataModel.jar" > + <uptodate property="java-up-to-date" targetfile="${dist}/sleuthkit-${VERSION}.jar" > <srcfiles dir="${src}" includes="**/*.java"/> </uptodate> <condition property="up-to-date"> @@ -161,13 +162,13 @@ <target name="Debug-SQLite" depends="check-build, init-ivy, compile, copyLibs-SQLiteDebug" unless="up-to-date" description="generate the debug distribution" > <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> - <jar jarfile="${dist}/Tsk_DataModel.jar" basedir="${build}"/> + <jar jarfile="${dist}/sleuthkit-${VERSION}.jar" basedir="${build}"/> </target> <target name="Debug-PostgreSQL" depends="init-ivy, compile, copyLibs-PostgreSQLDebug" description="generate the PostgreSQL debug distribution" > <!-- Put everything in ${build} into the MyProject-${DSTAMP}.jar file --> - <jar jarfile="${dist}/Tsk_DataModel_PostgreSQL.jar" basedir="${build}"/> + <jar jarfile="${dist}/sleuthkit-postgresql-${VERSION}.jar" basedir="${build}"/> </target> <target name="jni" depends="compile" description="make the jni.h file"> diff --git a/bindings/java/src/org/sleuthkit/datamodel/CommunicationsManager.java b/bindings/java/src/org/sleuthkit/datamodel/CommunicationsManager.java index d3134e5a05ccd6070b251080bf8f9565a76146b5..c726c671b402a536afad8802318c0185d5938911 100644 --- a/bindings/java/src/org/sleuthkit/datamodel/CommunicationsManager.java +++ b/bindings/java/src/org/sleuthkit/datamodel/CommunicationsManager.java @@ -77,6 +77,7 @@ public class CommunicationsManager { */ private void initAccountTypes() throws TskCoreException { CaseDbConnection connection = db.getConnection(); + db.acquireSingleUserCaseWriteLock(); Statement statement = null; ResultSet resultSet = null; @@ -115,6 +116,7 @@ private void initAccountTypes() throws TskCoreException { closeResultSet(resultSet); closeStatement(statement); connection.close(); + db.releaseSingleUserCaseWriteLock(); } } @@ -130,6 +132,7 @@ private void initAccountTypes() throws TskCoreException { */ private int readAccountTypes() throws SQLException, TskCoreException { CaseDbConnection connection = db.getConnection(); + db.acquireSingleUserCaseReadLock(); Statement statement = null; ResultSet resultSet = null; int count = 0; @@ -158,6 +161,7 @@ private int readAccountTypes() throws SQLException, TskCoreException { closeResultSet(resultSet); closeStatement(statement); connection.close(); + db.releaseSingleUserCaseReadLock(); } return count; diff --git a/configure.ac b/configure.ac index 628da3c2f488c63d75163ad651f536633841615b..39e453c6d2125f5fe327fe00b1deba3e19d068b4 100644 --- a/configure.ac +++ b/configure.ac @@ -4,9 +4,9 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) -AC_INIT(sleuthkit, 4.5.0) +AC_INIT(sleuthkit, 4.6.0) m4_include([m4/ax_pthread.m4]) -dnl include the version from 1.12.1. This will work for +dnl include the version from 1.12.1. This will work for m4_include([m4/cppunit.m4]) m4_include([m4/ax_jni_include_dir.m4]) m4_include([m4/ac_prog_javac_works.m4]) @@ -107,20 +107,20 @@ esac dnl Add enable/disable option AC_ARG_ENABLE([java], [AS_HELP_STRING([--disable-java], [Do not build the java bindings or jar file])]) - + dnl Checks for libraries. dnl Some platforms will complain about missing included functions if libstdc++ is not included. -AC_CHECK_LIB(stdc++, main, , AC_MSG_ERROR([missing libstdc++])) -AC_CHECK_HEADERS(list, , , AC_MSG_ERROR([missing STL list class header])) -AC_CHECK_HEADERS(map, , , AC_MSG_ERROR([missing STL map class header])) -AC_CHECK_HEADERS(queue, , , AC_MSG_ERROR([missing STL queue class header])) -AC_CHECK_HEADERS(set, , , AC_MSG_ERROR([missing STL set class header])) -AC_CHECK_HEADERS(stack, , , AC_MSG_ERROR([missing STL stack class header])) -AC_CHECK_HEADERS(streambuf, , , AC_MSG_ERROR([missing STL streambuf class header])) -AC_CHECK_HEADERS(string, , , AC_MSG_ERROR([missing STL string class header])) -AC_CHECK_HEADERS(vector, , , AC_MSG_ERROR([missing STL vector class header])) +AC_CHECK_LIB(stdc++, main, , AC_MSG_ERROR([missing libstdc++])) +AC_CHECK_HEADERS(list, , , AC_MSG_ERROR([missing STL list class header])) +AC_CHECK_HEADERS(map, , , AC_MSG_ERROR([missing STL map class header])) +AC_CHECK_HEADERS(queue, , , AC_MSG_ERROR([missing STL queue class header])) +AC_CHECK_HEADERS(set, , , AC_MSG_ERROR([missing STL set class header])) +AC_CHECK_HEADERS(stack, , , AC_MSG_ERROR([missing STL stack class header])) +AC_CHECK_HEADERS(streambuf, , , AC_MSG_ERROR([missing STL streambuf class header])) +AC_CHECK_HEADERS(string, , , AC_MSG_ERROR([missing STL string class header])) +AC_CHECK_HEADERS(vector, , , AC_MSG_ERROR([missing STL vector class header])) dnl Check for sqlite and its dependencies AC_CHECK_HEADERS([sqlite3.h], @@ -223,7 +223,7 @@ AS_IF([test "x$with_libewf" != "xno"], dnl Test the dir if they specified something beyond yes/no [AS_IF([test "x$with_libewf" != "xyes"], [AS_IF([test -d ${with_libewf}/include], - [CPPFLAGS="$CPPFLAGS -I${with_libewf}/include" + [CPPFLAGS="$CPPFLAGS -I${with_libewf}/include" LDFLAGS="$LDFLAGS -L${with_libewf}/lib"], dnl Dir given was not correct [AC_MSG_FAILURE([libewf directory not found at ${with_libewf}])]) @@ -337,7 +337,7 @@ AC_CONFIG_FILES([ tests/Makefile samples/Makefile man/Makefile - bindings/java/Makefile + bindings/java/Makefile bindings/java/jni/Makefile unit_tests/Makefile unit_tests/base/Makefile]) @@ -355,4 +355,3 @@ Features: Java/JNI support: $ax_java_support Multithreading: $ax_multithread ]); - diff --git a/tsk/fs/hfs.c b/tsk/fs/hfs.c index 2ba5d995ede265de4834c9c01435279d5c28d319..d9825a84bcb7b5a082688df39552501222d0dcfd 100644 --- a/tsk/fs/hfs.c +++ b/tsk/fs/hfs.c @@ -742,8 +742,9 @@ hfs_ext_find_extent_record_attr(HFS_INFO * hfs, uint32_t cnid, } // OK, this is one of the extents records that we are seeking, so save it. + // Make sure there is room for the hfs_extents struct keylen = 2 + tsk_getu16(fs->endian, key->key_len); - if (rec_off + keylen > nodesize) { + if (rec_off + keylen + sizeof(hfs_extents) > nodesize) { tsk_error_set_errno(TSK_ERR_FS_GENFS); tsk_error_set_errstr ("hfs_ext_find_extent_record_attr: offset and keylenth of record %d in leaf node %d too large (%d vs %" diff --git a/tsk/fs/iso9660.c b/tsk/fs/iso9660.c index 7dce80237c2e676d14212fa36f43c4cc3f74f899..66735b942725c2a870c0a5ab667e506524a8e102 100644 --- a/tsk/fs/iso9660.c +++ b/tsk/fs/iso9660.c @@ -507,6 +507,7 @@ iso9660_load_inodes_dir(TSK_FS_INFO * fs, TSK_OFF_T a_offs, int count, tsk_error_set_errno(TSK_ERR_FS_ARG); tsk_error_set_errstr ("iso9660_load_inodes_dir: Name argument specified is too long"); + free(in_node); return -1; } strncpy(in_node->inode.fn, a_fn, ISO9660_MAXNAMLEN_STD + 1); @@ -616,6 +617,7 @@ iso9660_load_inodes_dir(TSK_FS_INFO * fs, TSK_OFF_T a_offs, int count, if (tsk_verbose) tsk_fprintf(stderr, "iso9660_load_inodes_dir: length of name after processing is 0. bailing\n"); + free(in_node); break; } @@ -634,6 +636,7 @@ iso9660_load_inodes_dir(TSK_FS_INFO * fs, TSK_OFF_T a_offs, int count, tsk_fprintf(stderr, "iso9660_load_inodes_dir: file starts past end of image (%"PRIu32"). bailing\n", tsk_getu32(fs->endian, dentry->ext_loc_m)); + free(in_node); break; } in_node->offset = @@ -644,6 +647,7 @@ iso9660_load_inodes_dir(TSK_FS_INFO * fs, TSK_OFF_T a_offs, int count, tsk_fprintf(stderr, "iso9660_load_inodes_dir: file ends past end of image (%"PRIu32" bytes). bailing\n", tsk_getu32(fs->endian, in_node->inode.dr.data_len_m) + in_node->offset); + free(in_node); break; } /* record size to make sure fifos show up as unique files */ @@ -676,6 +680,7 @@ iso9660_load_inodes_dir(TSK_FS_INFO * fs, TSK_OFF_T a_offs, int count, if (tsk_verbose) tsk_fprintf(stderr, "iso9660_load_inodes_dir: parse_susp returned error (%s). bailing\n", tsk_error_get()); + free(in_node); break; } @@ -1141,6 +1146,15 @@ iso9660_close(TSK_FS_INFO * fs) free(s); } + while (iso->in_list != NULL) { + iso9660_inode_node *in = iso->in_list; + iso->in_list = iso->in_list->next; + if (in->inode.rr != NULL) { + free(in->inode.rr); + } + free(in); + } + tsk_fs_free(fs); } diff --git a/tsk/fs/ntfs.c b/tsk/fs/ntfs.c index 2644b320f082d489c6b23cf8fbb2b3dec8e6be2f..5715374d046628ba77a30290dd1f913c0c8f6cdc 100755 --- a/tsk/fs/ntfs.c +++ b/tsk/fs/ntfs.c @@ -1981,6 +1981,15 @@ ntfs_proc_attrseq(NTFS_INFO * ntfs, /* the compression unit size is stored in the header * it is stored as the power of 2 (if it is not 0) */ + if (tsk_getu16(fs->endian, attr->c.nr.compusize) > 16) { + /* 64k is the maximum compression unit size */ + tsk_error_reset(); + tsk_error_set_errno(TSK_ERR_FS_CORRUPT); + tsk_error_set_errstr("ntfs_proc_attrseq: Compression unit size 2^%d too large", + tsk_getu16(fs->endian, attr->c.nr.compusize)); + return TSK_COR; + } + if (tsk_getu16(fs->endian, attr->c.nr.compusize) > 0) { compsize = 1 << (tsk_getu16(fs->endian, attr->c.nr.compusize));