aboutsummaryrefslogtreecommitdiff
path: root/src/scalarproduct/scalarproduct_api.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2014-11-30 19:49:02 +0000
committerChristian Grothoff <christian@grothoff.org>2014-11-30 19:49:02 +0000
commit8e013a4a1792ec10f213d7d0c1b7e5442b9559cf (patch)
treea39bf5521b7d00803636c865f095ce63354d6cf1 /src/scalarproduct/scalarproduct_api.c
parent147e93e5a3a8d35748665b6b3adb4ea72988d9c6 (diff)
downloadgnunet-8e013a4a1792ec10f213d7d0c1b7e5442b9559cf.tar.gz
gnunet-8e013a4a1792ec10f213d7d0c1b7e5442b9559cf.zip
-handle msg NULL
Diffstat (limited to 'src/scalarproduct/scalarproduct_api.c')
-rw-r--r--src/scalarproduct/scalarproduct_api.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/scalarproduct/scalarproduct_api.c b/src/scalarproduct/scalarproduct_api.c
index 747dd6872..26c69dd13 100644
--- a/src/scalarproduct/scalarproduct_api.c
+++ b/src/scalarproduct/scalarproduct_api.c
@@ -17,7 +17,6 @@
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330, 17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA. 18 Boston, MA 02111-1307, USA.
19 */ 19 */
20
21/** 20/**
22 * @file scalarproduct/scalarproduct_api.c 21 * @file scalarproduct/scalarproduct_api.c
23 * @brief API for the scalarproduct 22 * @brief API for the scalarproduct
@@ -156,8 +155,10 @@ process_result_message (struct GNUNET_SCALARPRODUCT_ComputationHandle *h,
156 gcry_mpi_t num; 155 gcry_mpi_t num;
157 size_t rsize; 156 size_t rsize;
158 157
159 if (ntohs (msg->header.size) - sizeof (struct ClientResponseMessage) 158 if ( (GNUNET_SCALARPRODUCT_Status_Success == status) &&
160 != product_len) 159 ( (NULL == msg) ||
160 ( (ntohs (msg->header.size) - sizeof (struct ClientResponseMessage)
161 != product_len) ) ) )
161 { 162 {
162 GNUNET_break (0); 163 GNUNET_break (0);
163 status = GNUNET_SCALARPRODUCT_Status_InvalidResponse; 164 status = GNUNET_SCALARPRODUCT_Status_InvalidResponse;
@@ -191,7 +192,9 @@ process_result_message (struct GNUNET_SCALARPRODUCT_ComputationHandle *h,
191 } 192 }
192 } 193 }
193 } 194 }
194 h->cont_datum (h->cont_cls, status, result); 195 h->cont_datum (h->cont_cls,
196 status,
197 result);
195 if (NULL != result) 198 if (NULL != result)
196 gcry_mpi_release (result); 199 gcry_mpi_release (result);
197 GNUNET_SCALARPRODUCT_cancel (h); 200 GNUNET_SCALARPRODUCT_cancel (h);