Fix to multiple evaluation in htonl macro

pull/477/head
Jaroslav Ban 2020-10-09 18:11:37 +02:00
rodzic b86f0ee4e5
commit ff8f7b3e6c
1 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -15,8 +15,10 @@
#include "log.h"
#define htonl(x) (((x & 0xff) << 24) | ((x & 0xff00) << 8) \
| ((x & 0xff0000) >> 8) | ((x & 0xff000000) >> 24) )
#define htonl(x) ((((x) & 0xff) << 24) | \
(((x) & 0xff00) << 8) | \
(((x) & 0xff0000) >> 8) | \
(((x) & 0xff000000) >> 24))
int is_extension_request(uint8_t * kh, int len)
{
@ -65,7 +67,8 @@ int16_t bridge_u2f_to_extensions(uint8_t * _chal, uint8_t * _appid, uint8_t klen
uint8_t sig[72];
if (extension_needs_atomic_count(klen, keyh))
{
count = htonl(ctap_atomic_count(0));
count = ctap_atomic_count(0);
count = htonl(count);
}
else
{