Module Name: othersrc
Committed By: agc
Date: Thu Oct 13 15:13:39 UTC 2011
Modified Files:
othersrc/crypto/external/bsd/ssss/dist/src/libssss: secsplit.c
Log Message:
remove a commented out line, and distribute the size allocation nearer
to where it's used: make sure there's enough space in the allocated
arrays, especially when odd numbers of bytes are being split/joined.
To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
othersrc/crypto/external/bsd/ssss/dist/src/libssss/secsplit.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: othersrc/crypto/external/bsd/ssss/dist/src/libssss/secsplit.c
diff -u othersrc/crypto/external/bsd/ssss/dist/src/libssss/secsplit.c:1.2 othersrc/crypto/external/bsd/ssss/dist/src/libssss/secsplit.c:1.3
--- othersrc/crypto/external/bsd/ssss/dist/src/libssss/secsplit.c:1.2 Thu Aug 18 04:19:47 2011
+++ othersrc/crypto/external/bsd/ssss/dist/src/libssss/secsplit.c Thu Oct 13 15:13:39 2011
@@ -466,7 +466,6 @@ assemble(s4_t *s4, thresh_str_t *inputs,
}
inputs[i].c += sizeof(heads[i]);
x[i] = heads[i].coeff;
- //inputs[i].io.size += 2;
}
for (;;) {
if ((d = get_assemble(s4, nin, inputs, x, mod, &oddflag)) == -1) {
@@ -532,7 +531,7 @@ split_memory(threshold_t *thresh, const
/* allocate space for outputs */
thresh->sharesc = (unsigned)sharesc;
for (i = 0 ; i < sharesc ; i++) {
- thresh->shares[i].io.size = memsize + sizeof(thresh_head_t);
+ thresh->shares[i].io.size = memsize + sizeof(thresh_head_t) + 2;
thresh->shares[i].c = 0;
if (thresh->shares[i].io.base == NULL &&
(thresh->shares[i].io.base = calloc(1, thresh->shares[i].io.size)) == NULL) {
@@ -579,7 +578,7 @@ int
s4_combine(threshold_t *thresh)
{
if (!join_memory(thresh, thresh->shares,
- thresh->shares[0].io.size, thresh->threshold,
+ thresh->shares[0].io.size - 2, thresh->threshold,
&thresh->shares[THRESH_JOIN_DEST])) {
return -1;
}