Skip to content

Fixes warnings for sign-compare#8

Open
kcalvinalvin wants to merge 1 commit into
mit-dci:masterfrom
kcalvinalvin:make-compiler-happy
Open

Fixes warnings for sign-compare#8
kcalvinalvin wants to merge 1 commit into
mit-dci:masterfrom
kcalvinalvin:make-compiler-happy

Conversation

@kcalvinalvin

Copy link
Copy Markdown
Member

Fixes the code so that the sign comparison warnings go away.

Comment thread src/batchproof.cpp Outdated
}

int data_offset = 0;
uint8_t data_offset = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pretty sure this would overflow as an uint8_t while reading the hashes here:

data_offset += 32;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to uint32_t.

Fixes the code so that the sign comparison warnings go away.
Comment thread src/batchproof.cpp
}

int data_offset = 0;
uint8_t data_offset = 0;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like it will overflow here

data_offset += 4;
or
data_offset += 32;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants