diff options
author | Christian Göttsche <cgzones@googlemail.com> | 2021-01-09 14:25:46 +0100 |
---|---|---|
committer | Christian Göttsche <cgzones@googlemail.com> | 2021-01-09 14:25:46 +0100 |
commit | 08adbf76c1d91a527235b68a17628eb04b681f6f (patch) | |
tree | 89ef69eb82755754f8bc019aa3e673656af8f476 | |
parent | 8d7a7668dd68f12a3d9232ee5323805107b70cbb (diff) | |
download | rspamd-08adbf76c1d91a527235b68a17628eb04b681f6f.tar.gz rspamd-08adbf76c1d91a527235b68a17628eb04b681f6f.zip |
Check gsize against G_MAXSIZE not ULLONG_MAX
/builds/cgzones/rspamd/debian/output/source_dir/src/libserver/http/http_message.c: In function 'rspamd_http_message_set_body':
/builds/cgzones/rspamd/debian/output/source_dir/src/libserver/http/http_message.c:201:23: warning: comparison is always true due to limited range of data type [-Wtype-limits]
201 | if (len != 0 && len != ULLONG_MAX) {
| ^~
/builds/cgzones/rspamd/debian/output/source_dir/src/libserver/http/http_message.c:230:23: warning: comparison is always true due to limited range of data type [-Wtype-limits]
230 | if (len != 0 && len != ULLONG_MAX) {
| ^~
-rw-r--r-- | src/libserver/http/http_message.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libserver/http/http_message.c b/src/libserver/http/http_message.c index 5f9d22178..e68778f3e 100644 --- a/src/libserver/http/http_message.c +++ b/src/libserver/http/http_message.c @@ -198,7 +198,7 @@ rspamd_http_message_set_body (struct rspamd_http_message *msg, return FALSE; } - if (len != 0 && len != ULLONG_MAX) { + if (len != 0 && len != G_MAXSIZE) { if (ftruncate (storage->shared.shm_fd, len) == -1) { return FALSE; } @@ -227,7 +227,7 @@ rspamd_http_message_set_body (struct rspamd_http_message *msg, } } else { - if (len != 0 && len != ULLONG_MAX) { + if (len != 0 && len != G_MAXSIZE) { if (data == NULL) { storage->normal = rspamd_fstring_sized_new (len); msg->body_buf.len = 0; |