Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing LABEL TEXT attribute bind causes crash in shp2img #5558

Closed
geographika opened this issue Mar 7, 2018 · 1 comment

Comments

@geographika
Copy link
Member

commented Mar 7, 2018

On MapServer 7.0.4, Windows x64 I am getting the following error / crash when using more than one iteration of shp2img, and referring to a field name that does not exist for LABEL text:

Unhandled exception thrown: write access violation.
msyystring_buffer was nullptr.

This occurs in mapfile.c - line 6751:

  msyystate = MS_TOKENIZE_FILE;
  msyylex(); /* sets things up, but doesn't process any tokens */

  msyyrestart(msyyin);  // crash here

Running one iteration of shp2img works:

shp2img -m test.map -c 1 -o test.png

Running two iterations causes a crash:

shp2img -m test.map -c 2 -o test.png

Test Mapfile below.

MAP    
    EXTENT 0 0 100 100
    SIZE 100 100
    LAYER
        TYPE POINT
        STATUS ON
        FEATURE
            POINTS
                50 50
            END
        END
        CLASS
            LABEL
                TEXT "[Missing]"
            END
        END
    END
END
@sdlime sdlime self-assigned this Jun 6, 2018
@rouault rouault closed this in acaf81c Sep 10, 2019
rouault added a commit that referenced this issue Sep 10, 2019
Fix memory leak in msINLINELayerNextShape() and null pointer dereference in maplexer when rerunning it after msCleanup() (fixes #5558)
backporting bot pushed a commit that referenced this issue Sep 10, 2019
…nce in maplexer when rerunning it after msCleanup() (fixes #5558)
rouault added a commit that referenced this issue Sep 10, 2019
[Backport branch-7-4] Fix memory leak in msINLINELayerNextShape() and null pointer dereference in maplexer when rerunning it after msCleanup() (fixes #5558)
@geographika

This comment has been minimized.

Copy link
Member Author

commented Sep 10, 2019

Thanks @rouault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.