File tree Expand file tree Collapse file tree 3 files changed +7
-5
lines changed
Expand file tree Collapse file tree 3 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 2929 - name : Initialize CodeQL
3030 uses : github/codeql-action/init@v1
3131
32- - run : sudo apt install libipc-run3-perl libfile-slurp-perl libfile-which-perl pandoc
32+ - run : sudo apt install libipc-run3-perl libipc-system-simple-perl libfile-slurp-perl libfile-which-perl pandoc
3333 - run : |
3434 ./bootstrap
3535 ./configure
Original file line number Diff line number Diff line change 99* The CMake build now uses the correct library directory on Linux systems
1010 using alternate directory structures. Pull request by Satadru Pramanik.
1111 GitHub #284 .
12+ * File size check now correctly compares the size to ` SSIZE_MAX ` . Reported
13+ by marakew. GitHub #301 .
1214
1315## 1.6.0 - 2021-04-29
1416
Original file line number Diff line number Diff line change 88#include <errno.h>
99#include <fcntl.h>
1010#include <inttypes.h>
11+ #include <limits.h>
1112#include <stdint.h>
1213#include <stdlib.h>
1314#include <string.h>
@@ -406,7 +407,6 @@ cleanup:;
406407#else // _WIN32
407408
408409static int map_file (MMDB_s * const mmdb ) {
409- ssize_t size ;
410410 int status = MMDB_SUCCESS ;
411411
412412 int o_flags = O_RDONLY ;
@@ -432,8 +432,8 @@ static int map_file(MMDB_s *const mmdb) {
432432 goto cleanup ;
433433 }
434434
435- size = s .st_size ;
436- if (size < 0 || size != s . st_size ) {
435+ off_t size = s .st_size ;
436+ if (size < 0 || size > SSIZE_MAX ) {
437437 status = MMDB_OUT_OF_MEMORY_ERROR ;
438438 goto cleanup ;
439439 }
@@ -449,7 +449,7 @@ static int map_file(MMDB_s *const mmdb) {
449449 goto cleanup ;
450450 }
451451
452- mmdb -> file_size = size ;
452+ mmdb -> file_size = ( ssize_t ) size ;
453453 mmdb -> file_content = file_content ;
454454
455455cleanup :;
You can’t perform that action at this time.
0 commit comments