Skip to content

Commit 30e9f43

Browse files
[2/2]Fixes char to unsigned char for byte representation
The forcing of signed char type was introduced by 3fb3bb5d38r, "configure: force 'char' type to be signed (#4025)". Thus at xlators/features/compress/src/cdc-helper.c was found the use of a char type to represent bytes, when it should be using an unsigned type to avoid sign extension and overflow. This commit changes the variable "gzip_header" to "unsigned" type. Signed-off-by: Thales Antunes de Oliveira Barretto <[email protected]> # xlators/features/compress/src/cdc-helper.c | 4 ++-- # 1 file changed, 2 insertions(+), 2 deletions(-) # xlators/features/compress/src/cdc-helper.c | 4 ++-- # 1 file changed, 2 insertions(+), 2 deletions(-)
1 parent 69011fb commit 30e9f43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xlators/features/compress/src/cdc-helper.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@
3030
* gzip_header is added only during debugging.
3131
* Refer to the function cdc_dump_iovec_to_disk
3232
*/
33-
static const char gzip_header[10] = {'\037', '\213', Z_DEFLATED, 0, 0, 0, 0,
34-
0, 0, GF_CDC_OS_ID};
33+
static const unsigned char gzip_header[10] = {
34+
'\037', '\213', Z_DEFLATED, 0, 0, 0, 0, 0, 0, GF_CDC_OS_ID};
3535

3636
static int32_t
3737
cdc_next_iovec(cdc_info_t *ci)

0 commit comments

Comments
 (0)