From 0edf0a0888b1e40769e19eee031c2cefdcf37d26 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 2 Sep 2019 13:26:47 +0200 Subject: [SERVER] Fix compiler warnings --- src/shared/protocol.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/shared/protocol.h') diff --git a/src/shared/protocol.h b/src/shared/protocol.h index 92dbe11..2b21c21 100644 --- a/src/shared/protocol.h +++ b/src/shared/protocol.h @@ -20,7 +20,7 @@ #define COND_HOPCOUNT(vers,hopcount) ( (vers) >= 3 ? (hopcount) : 0 ) // 2017-11-02: Macro to set flags in select image message properly if we're a server, as BG_REP depends on global var -#define SI_SERVER_FLAGS ( (_pretendClient ? 0 : FLAGS8_SERVER) | (_backgroundReplication == BGR_FULL ? FLAGS8_BG_REP : 0) ) +#define SI_SERVER_FLAGS ( (uint8_t)( (_pretendClient ? 0 : FLAGS8_SERVER) | (_backgroundReplication == BGR_FULL ? FLAGS8_BG_REP : 0) ) ) #define REPLY_OK (0) #define REPLY_ERRNO (-1) -- cgit v1.2.3-55-g7522 From dcece877215a0d909553ae9301a02d031b37b715 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 30 Jun 2020 11:21:31 +0200 Subject: [SHARED] Fix 16 byte information leakage in select image message --- src/shared/protocol.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'src/shared/protocol.h') diff --git a/src/shared/protocol.h b/src/shared/protocol.h index 2b21c21..05fd2bf 100644 --- a/src/shared/protocol.h +++ b/src/shared/protocol.h @@ -69,10 +69,8 @@ static inline bool dnbd3_select_image(int sock, const char *name, uint16_t rid, request.magic = dnbd3_packet_magic; request.cmd = CMD_SELECT_IMAGE; request.size = (uint32_t)len; -#ifdef _DEBUG request.handle = 0; request.offset = 0; -#endif fixup_request( request ); iov[0].iov_base = &request; iov[0].iov_len = sizeof(request); -- cgit v1.2.3-55-g7522