aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan McCrohan <jmccrohan@gmail.com>2012-10-30 21:33:07 +0000
committerJonathan McCrohan <jmccrohan@gmail.com>2012-10-30 21:33:07 +0000
commit51677095c675a778c53580589270203930c61a87 (patch)
treeae4c7470d8ecdac8cbcec313d2c0738f1b6929cf
parentb870e05547bc189f29569a5d21db0c875c8f9983 (diff)
downloaddhex-51677095c675a778c53580589270203930c61a87.tar.gz
Imported Upstream version 0.68upstream/0.68upstream
-rw-r--r--README.txt2
-rw-r--r--buffers.c11
-rw-r--r--main.c2
-rw-r--r--mkrelease.sh14
4 files changed, 20 insertions, 9 deletions
diff --git a/README.txt b/README.txt
index ff0f613..83e1c94 100644
--- a/README.txt
+++ b/README.txt
@@ -22,6 +22,8 @@ Thomas Dettbarn, 30-Dec-2010
color themes were fixed
0.67: a "base address" functionality was added, which makes it easier to work
with memory dumps.
+0.68: slight bug fix as suggested by christoph: under some circumstances, the
+ opening of a file could segfault.
---------------------------------------------------------[ 1. Getting started ]-
diff --git a/buffers.c b/buffers.c
index 5f196ea..f19d885 100644
--- a/buffers.c
+++ b/buffers.c
@@ -13,11 +13,20 @@
//
tUInt32 openbuf(tBuffer* hBuf,tUInt8 bufnum,char* filename)
{
+ unsigned int filenamelen=0;
+ if (filename == NULL)
+ return RETNOK;
+
+ filenamelen=strlen(filename);
+ if (filenamelen>510)
+ filenamelen=510;
+
hBuf->changesnum=0;
hBuf->valid=0;
hBuf->fresh=1;
hBuf->file=fopen(filename,"rb");
- memcpy(hBuf->filename,filename,512);
+ memcpy(hBuf->filename,filename,filenamelen+1);
+
hBuf->filename[511]=0;
if (hBuf->file)
{
diff --git a/main.c b/main.c
index cb2964e..e6f014c 100644
--- a/main.c
+++ b/main.c
@@ -1,6 +1,6 @@
#define MAJORVERSION 0
#define MINORVERSION 6
-#define REVISION 7
+#define REVISION 8
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
diff --git a/mkrelease.sh b/mkrelease.sh
index d6fc4bc..d751b67 100644
--- a/mkrelease.sh
+++ b/mkrelease.sh
@@ -1,4 +1,4 @@
-mkdir dhex_0.67
+mkdir dhex_0.68
for I in `echo "
Makefile
buffers.c
@@ -37,11 +37,11 @@ dhex_markers.5
dhex_searchlog.5
mkrelease.sh" | sort -f`
do
- cp $I dhex_0.67/
+ cp $I dhex_0.68/
done
-( cd dhex_0.67/ && make && ./dhex -v && make clean && cd .. && \
-tar cvfz dhex_0.67.tar.gz dhex_0.67 )
-cp dhex_0.67.tar.gz dhex_latest.tar.gz
-md5 dhex_0.67.tar.gz
-md5 dhex_latest.tar.gz
+( cd dhex_0.68/ && make && ./dhex -v && make clean && cd .. && \
+tar cvfz dhex_0.68.tar.gz dhex_0.68 )
+cp dhex_0.68.tar.gz dhex_latest.tar.gz
+md5sum dhex_0.68.tar.gz
+md5sum dhex_latest.tar.gz