[mapserver-commits] [MapServer/MapServer] 1c8f9b: mapshape, mapxbase: move code to functions with VS...

Even Rouault noreply at github.com
Thu Oct 28 06:39:23 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/MapServer/MapServer
  Commit: 1c8f9bf6ace07f8ddf1cbd10ab63e21213a3bb3b
      https://github.com/MapServer/MapServer/commit/1c8f9bf6ace07f8ddf1cbd10ab63e21213a3bb3b
  Author: Max Kellermann <max.kellermann at gmail.com>
  Date:   2021-10-14 (Thu, 14 Oct 2021)

  Changed paths:
    M mapshape.c
    M mapshape.h
    M mapxbase.c

  Log Message:
  -----------
  mapshape, mapxbase: move code to functions with VSILFILE* parameters

Draft, just a tech demo for the fuzzer!  This duplicates some code
from msSHPOpen(), which is bad.


  Commit: 8ef10d0712a2260905273e7dd0c99546fb98e7cd
      https://github.com/MapServer/MapServer/commit/8ef10d0712a2260905273e7dd0c99546fb98e7cd
  Author: Max Kellermann <max.kellermann at gmail.com>
  Date:   2021-10-15 (Fri, 15 Oct 2021)

  Changed paths:
    M CMakeLists.txt
    A fuzzers/CMakeLists.txt
    A fuzzers/shapefuzzer.c
    M mapshape.c

  Log Message:
  -----------
  fuzzer: a Shapefile fuzzer using libFuzzer

How to build:

 rm -rf build/fuzzer && mkdir -p build/fuzzer && (cd build/fuzzer && cmake ../.. -GNinja -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DWITH_PROTOBUFC=off -DWITH_POSTGIS=off -DWITH_ICONV=OFF -DFUZZER=ON)
 ninja -C build/fuzzer fuzzers/shapefuzzer

Then generate a start file from a very small shapefile; it contains
SHP, SHX and DBF separated by the string "deadbeef":

 { cat foo.shp; echo -n "deadbeef"; cat foo.shx; echo -n "deadbeef"; cat foo.dbf; } >/tmp/corpus/start

Finally, run the fuzzer:

 ./build/fuzzer/fuzzers/shapefuzzer /tmp/corpus

More information about libFuzzer: https://llvm.org/docs/LibFuzzer.html


  Commit: ba726960b0a74f6ded19efb28edccb78bead8018
      https://github.com/MapServer/MapServer/commit/ba726960b0a74f6ded19efb28edccb78bead8018
  Author: Even Rouault <even.rouault at spatialys.com>
  Date:   2021-10-28 (Thu, 28 Oct 2021)

  Changed paths:
    M CMakeLists.txt
    A fuzzers/CMakeLists.txt
    A fuzzers/shapefuzzer.c
    M mapshape.c
    M mapshape.h
    M mapxbase.c

  Log Message:
  -----------
  Merge pull request #6421 from MaxKellermann/shapefile_fuzzer

Shapefile fuzzer


Compare: https://github.com/MapServer/MapServer/compare/2d06af06f72a...ba726960b0a7


More information about the mapserver-commits mailing list