diff options
author | Christian Grothoff <christian@grothoff.org> | 2013-12-12 18:36:19 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2013-12-12 18:36:19 +0000 |
commit | c5aa99a45114bcbf3cb4e8d399c494f29bb10a48 (patch) | |
tree | dff40b4b91256121934539fe405d2059d3a46ae2 /src/secretsharing | |
parent | 87263f90e084d704fbc37021acf83c2da3e14d3f (diff) | |
download | gnunet-c5aa99a45114bcbf3cb4e8d399c494f29bb10a48.tar.gz gnunet-c5aa99a45114bcbf3cb4e8d399c494f29bb10a48.zip |
-removing code that just dereferenced uninitialized 'm' and then decided to randomly increment memory
Diffstat (limited to 'src/secretsharing')
-rw-r--r-- | src/secretsharing/gnunet-service-secretsharing.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/src/secretsharing/gnunet-service-secretsharing.c b/src/secretsharing/gnunet-service-secretsharing.c index 3923dc286..926861ac7 100644 --- a/src/secretsharing/gnunet-service-secretsharing.c +++ b/src/secretsharing/gnunet-service-secretsharing.c | |||
@@ -508,7 +508,6 @@ keygen_round2_conclude (void *cls) | |||
508 | unsigned int i; | 508 | unsigned int i; |
509 | gcry_mpi_t s; | 509 | gcry_mpi_t s; |
510 | gcry_mpi_t h; | 510 | gcry_mpi_t h; |
511 | struct GNUNET_PeerIdentity *pid; | ||
512 | 511 | ||
513 | GNUNET_assert (0 != (s = gcry_mpi_new (PAILLIER_BITS))); | 512 | GNUNET_assert (0 != (s = gcry_mpi_new (PAILLIER_BITS))); |
514 | GNUNET_assert (0 != (h = gcry_mpi_new (PAILLIER_BITS))); | 513 | GNUNET_assert (0 != (h = gcry_mpi_new (PAILLIER_BITS))); |
@@ -516,8 +515,6 @@ keygen_round2_conclude (void *cls) | |||
516 | // multiplicative identity | 515 | // multiplicative identity |
517 | gcry_mpi_set_ui (s, 1); | 516 | gcry_mpi_set_ui (s, 1); |
518 | 517 | ||
519 | pid = (void *) &m[1]; | ||
520 | |||
521 | for (i = 0; i < ks->num_peers; i++) | 518 | for (i = 0; i < ks->num_peers; i++) |
522 | { | 519 | { |
523 | if (GNUNET_NO == ks->info[i].disqualified) | 520 | if (GNUNET_NO == ks->info[i].disqualified) |
@@ -525,8 +522,6 @@ keygen_round2_conclude (void *cls) | |||
525 | gcry_mpi_addm (s, s, ks->info[i].decrypted_preshare, elgamal_p); | 522 | gcry_mpi_addm (s, s, ks->info[i].decrypted_preshare, elgamal_p); |
526 | gcry_mpi_mulm (h, h, ks->info[i].public_key_share, elgamal_p); | 523 | gcry_mpi_mulm (h, h, ks->info[i].public_key_share, elgamal_p); |
527 | m->num_secret_peers++; | 524 | m->num_secret_peers++; |
528 | *pid = ks->info[i].peer; | ||
529 | pid++; | ||
530 | } | 525 | } |
531 | } | 526 | } |
532 | 527 | ||
@@ -567,7 +562,7 @@ insert_round2_element (struct KeygenSession *ks) | |||
567 | GNUNET_assert (0 != (idx = gcry_mpi_new (PAILLIER_BITS))); | 562 | GNUNET_assert (0 != (idx = gcry_mpi_new (PAILLIER_BITS))); |
568 | 563 | ||
569 | element_size = (sizeof (struct GNUNET_SECRETSHARING_KeygenRevealData) + | 564 | element_size = (sizeof (struct GNUNET_SECRETSHARING_KeygenRevealData) + |
570 | 2 * PAILLIER_BITS / 8 * ks->num_peers + | 565 | 2 * PAILLIER_BITS / 8 * ks->num_peers + |
571 | 1 * PAILLIER_BITS / 8 * ks->threshold); | 566 | 1 * PAILLIER_BITS / 8 * ks->threshold); |
572 | 567 | ||
573 | element = GNUNET_malloc (sizeof (struct GNUNET_SET_Element) + element_size); | 568 | element = GNUNET_malloc (sizeof (struct GNUNET_SET_Element) + element_size); |