fix 0-length VLAs

This commit is contained in:
Christian Grothoff 2023-05-10 00:57:04 +02:00
parent aedd13a778
commit 3ebd0a70b2
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 13 additions and 12 deletions

View File

@ -780,10 +780,11 @@ TALER_KYCLOGIC_kyc_init (const struct GNUNET_CONFIGURATION_Handle *cfg)
TALER_KYCLOGIC_kyc_done ();
return GNUNET_SYSERR;
}
qsort (kyc_triggers,
num_kyc_triggers,
sizeof (struct TALER_KYCLOGIC_KycTrigger *),
&sort_by_timeframe);
if (0 != num_kyc_triggers)
qsort (kyc_triggers,
num_kyc_triggers,
sizeof (struct TALER_KYCLOGIC_KycTrigger *),
&sort_by_timeframe);
return GNUNET_OK;
}

View File

@ -1366,10 +1366,10 @@ keys_completed_cb (void *cls,
kd.num_denom_keys);
/* First make a shallow copy, we then need another pass for the RSA key... */
memcpy (kd.denom_keys,
kd_old.denom_keys,
kd_old.num_denom_keys * sizeof (struct
TALER_EXCHANGE_DenomPublicKey));
GNUNET_memcpy (kd.denom_keys,
kd_old.denom_keys,
kd_old.num_denom_keys * sizeof (struct
TALER_EXCHANGE_DenomPublicKey));
for (unsigned int i = 0; i<kd_old.num_denom_keys; i++)
TALER_denom_pub_deep_copy (&kd.denom_keys[i].key,
@ -1391,10 +1391,10 @@ keys_completed_cb (void *cls,
GNUNET_array_grow (anew->denom_keys,
anew->num_denom_keys,
aold->num_denom_keys);
memcpy (anew->denom_keys,
aold->denom_keys,
aold->num_denom_keys
* sizeof (struct TALER_EXCHANGE_AuditorDenominationInfo));
GNUNET_memcpy (anew->denom_keys,
aold->denom_keys,
aold->num_denom_keys
* sizeof (struct TALER_EXCHANGE_AuditorDenominationInfo));
}
/* Old auditors got just copied into new ones. */