1
Description: fix buffer overflow when using --embed-crc-delimiter
2
The patch from upstream GIT, fixes a glibc memory warning, reported on
3
some systems while building rhash, on the 'make test' step.
5
Origin: upstream https://github.com/rhash/RHash/commit/c8c6cc870dbe51a507b98b9cc5925179400b3ff7
6
Author: Aleksey Kravchenko <rhash.admin@gmail.com>
7
Bug-RHash: https://sourceforge.net/tracker/?func=detail&aid=3391587&group_id=205103&atid=992288
8
Forwarded: sent-to-upstream
9
Last-Update: 2011-08-23
12
diff -Nur rhash-1.2.7.orig/calc_sums.c rhash-1.2.7.new/calc_sums.c
13
--- rhash-1.2.7.orig/calc_sums.c 2011-08-08 12:03:06.000000000 +0700
14
+++ rhash-1.2.7.new/calc_sums.c 2011-08-20 14:24:45.213842707 +0700
19
- /* now p is the point to insert the 10-bytes hash string */
20
- new_path = (char*)rsh_malloc(len + 11);
21
+ /* now p is the point to insert delimiter + hash string in brackets */
22
+ new_path = (char*)rsh_malloc(len + 12);
23
insertion_point = new_path + (p - info->full_path);
24
memcpy(new_path, info->full_path, p - info->full_path);
25
if(opt.embed_crc_delimiter && *opt.embed_crc_delimiter) *(insertion_point++) = *opt.embed_crc_delimiter;