summaryrefslogtreecommitdiff
path: root/db.c
diff options
context:
space:
mode:
authorJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2014-01-07 20:27:07 -0500
committerJeffrey Armstrong <jeffrey.armstrong@approximatrix.com>2014-01-07 20:27:07 -0500
commitffe739eeb12d1bf9dadb2144e95fef79820c6844 (patch)
tree71bc466fa3d8be3c2d3c197388c49a2a3dda3907 /db.c
parentbe58b862309fabfae996b94c441bf778b09df463 (diff)
downloadprism-ffe739eeb12d1bf9dadb2144e95fef79820c6844.tar.gz
prism-ffe739eeb12d1bf9dadb2144e95fef79820c6844.zip
Fixed possible unterminated strings in hash handling in commit code.
Diffstat (limited to 'db.c')
-rw-r--r--db.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/db.c b/db.c
index e5ffb9d..39a28c6 100644
--- a/db.c
+++ b/db.c
@@ -219,8 +219,8 @@ int res;
reader++;
sep = strchr(reader, ' ');
- memset(info->hash, 0, 33);
- memcpy(info->hash, reader, 32);
+ memset(info->hash, 0, HASH_BYTES);
+ memcpy(info->hash, reader, HASH_BYTES-1);
break;
}
@@ -368,7 +368,7 @@ FILE *fpq;
char *line;
char *tmp;
struct db_file info;
-char newhash[33];
+char newhash[HASH_BYTES];
fpq = fopen(Q_FILENAME, "r");
if(fpq == NULL)