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

use-of-uninitialized-value in nsvg__minf() via nsvg__parseScale() #187

Open
invd opened this issue Sep 28, 2020 · 0 comments
Open

use-of-uninitialized-value in nsvg__minf() via nsvg__parseScale() #187

invd opened this issue Sep 28, 2020 · 0 comments

Comments

@invd
Copy link

invd commented Sep 28, 2020

MemorySanitizer reports use-of-uninitialized-value.

Shortened report, obtainable with -fsanitize=memory -fsanitize-memory-track-origins:

==12522==WARNING: MemorySanitizer: use-of-uninitialized-value
    #0 0x505817 in nsvg__minf /nanosvg/src/./nanosvg.h:228:64
    #1 0x5025f5 in nsvg__curveBounds /nanosvg/src/./nanosvg.h:573:14
    #2 0x4f6fb5 in nsvg__addPath /nanosvg/src/./nanosvg.h:1069:3
    #3 0x4c1510 in nsvg__parseLine /nanosvg/src/./nanosvg.h:2496:2
    #4 0x4a1b3c in nsvg__startElement /nanosvg/src/./nanosvg.h:2743:3
    #5 0x49fb70 in nsvg__parseElement /nanosvg/src/./nanosvg.h:321:3
    #6 0x49bc73 in nsvg__parseXML /nanosvg/src/./nanosvg.h:345:4
    #7 0x4a0472 in nsvgParse /nanosvg/src/./nanosvg.h:2928:2
    #8 0x4a9c90 in nsvgParseFromFile /nanosvg/src/./nanosvg.h:2958:10
    #9 0x4ac029 in main /nanosvg/src/nanosvg_msan_example1.c:10:24
[...]
  Uninitialized value was stored to memory at
    #0 0x4e1063 in nsvg__xformSetScale /nanosvg/src/./nanosvg.h:472
    #1 0x4db131 in nsvg__parseScale /nanosvg/src/./nanosvg.h:1560:2
    #2 0x4caad2 in nsvg__parseTransform /nanosvg/src/./nanosvg.h:1628:10
    #3 0x4c98f4 in nsvg__parseAttr /nanosvg/src/./nanosvg.h:1797:3
    #4 0x4c0102 in nsvg__parseLine /nanosvg/src/./nanosvg.h:2483:8
    #5 0x4a1b3c in nsvg__startElement /nanosvg/src/./nanosvg.h:2743:3
    #6 0x49fb70 in nsvg__parseElement /nanosvg/src/./nanosvg.h:321:3
    #7 0x49bc73 in nsvg__parseXML /nanosvg/src/./nanosvg.h:345:4
    #8 0x4a0472 in nsvgParse /nanosvg/src/./nanosvg.h:2928:2
    #9 0x4a9c90 in nsvgParseFromFile /nanosvg/src/./nanosvg.h:2958:10
    #10 0x4ac029 in main /nanosvg/src/nanosvg_msan_example1.c:10:24

  Uninitialized value was created by an allocation of 'args' in the stack frame of function 'nsvg__parseScale'
    #0 0x4dabb0 in nsvg__parseScale /nanosvg/src/./nanosvg.h:1554

Example input: msan_1.svg.zip

Mentioning @memononen, @oehhar, @fvogelnew1 for visibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant