Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- typedef struct ok_struct
- {
- ....
- size_t buf_len_save;
- size_t buf_off_save;
- ....
- } BIO_OK_CTX;
- static int ok_read(BIO *b, char *out, int outl)
- {
- ....
- BIO_OK_CTX *ctx;
- ....
- /* copy start of the next block into proper place */
- if(ctx->buf_len_save - ctx->buf_off_save > 0)
- ....
- }
- This suspicious code was found in OpenSSL project by PVS-Studio static code analyzer.
- Warning message is:
- V555 The expression of the 'A - B > 0' kind will work as 'A != B'. bio_ok.c 243
- PVS-Studio is a static analyzer for detecting bugs in the source code of applications written in C, C++, C++11, C++/CX. Site: http://www.viva64.com/en/pvs-studio/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement