{"action":"created","issue":{"url":"https://api.github.com/repos/neomutt/neomutt/issues/1315","repository_url":"https://api.github.com/repos/neomutt/neomutt","labels_url":"https://api.github.com/repos/neomutt/neomutt/issues/1315/labels{/name}","comments_url":"https://api.github.com/repos/neomutt/neomutt/issues/1315/comments","events_url":"https://api.github.com/repos/neomutt/neomutt/issues/1315/events","html_url":"https://github.com/neomutt/neomutt/issues/1315","id":351506434,"node_id":"MDU6SXNzdWUzNTE1MDY0MzQ=","number":1315,"title":"Possible buffer underflow in mutt/path.c","user":{"login":"z2v","id":2391248,"node_id":"MDQ6VXNlcjIzOTEyNDg=","avatar_url":"https://avatars2.githubusercontent.com/u/2391248?v=4","gravatar_id":"","url":"https://api.github.com/users/z2v","html_url":"https://github.com/z2v","followers_url":"https://api.github.com/users/z2v/followers","following_url":"https://api.github.com/users/z2v/following{/other_user}","gists_url":"https://api.github.com/users/z2v/gists{/gist_id}","starred_url":"https://api.github.com/users/z2v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/z2v/subscriptions","organizations_url":"https://api.github.com/users/z2v/orgs","repos_url":"https://api.github.com/users/z2v/repos","events_url":"https://api.github.com/users/z2v/events{/privacy}","received_events_url":"https://api.github.com/users/z2v/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-08-17T08:38:33Z","updated_at":"2018-08-17T11:52:45Z","closed_at":null,"author_association":"MEMBER","body":"<!--\r\nSorry you've found a bug, but thanks for reporting it here.\r\nPlease try to give as much information as you can.\r\n-->\r\n\r\n## Expected Behaviour\r\n\r\nTests pass.\r\n\r\n## Actual Behaviour\r\n\r\nRunning tests with AddressSanitizer enabled results in the following alert:\r\n```\r\ntest/neomutt-test\r\nTest test_base64_encode...                      [   OK   ]\r\nTest test_base64_decode...                      [   OK   ]\r\nTest test_base64_lengths...                     [   OK   ]\r\nTest test_rfc2047...                            [   OK   ]\r\nTest test_md5...                                [   OK   ]\r\nTest test_md5_ctx...                            [   OK   ]\r\nTest test_md5_ctx_bytes...                      [   OK   ]\r\nTest test_string_strfcpy...                     [   OK   ]\r\nTest test_string_strnfcpy...                    [   OK   ]\r\nTest test_addr_mbox_to_udomain...               [   OK   ]\r\nTest test_mutt_path_tidy_slash...               =================================================================\r\n==51915==ERROR: AddressSanitizer: stack-buffer-underflow on address 0x7fffffffe13f at pc 0x00000030a2b9 bp 0x7fffffffe010 sp 0x7fffffffe008\r\nREAD of size 1 at 0x7fffffffe13f thread T0\r\n    #0 0x30a2b8 in mutt_path_tidy_slash /home/vovka/projects/neomutt/mutt/path.c:85:8\r\n    #1 0x2d4201 in test_mutt_path_tidy_slash /home/vovka/projects/neomutt/test/path.c:41:5\r\n    #2 0x2d26dd in test_do_run__ /home/vovka/projects/neomutt/./test/acutest.h:464:9\r\n    #3 0x2d16ba in test_run__ /home/vovka/projects/neomutt/./test/acutest.h:546:23\r\n    #4 0x2d0c7b in main /home/vovka/projects/neomutt/./test/acutest.h:816:13\r\n    #5 0x249094 in _start /usr/src/lib/csu/amd64/crt1.c:74:7\r\n\r\nAddress 0x7fffffffe13f is located in stack of thread T0 at offset 31 in frame\r\n    #0 0x2d40af in test_mutt_path_tidy_slash /home/vovka/projects/neomutt/test/path.c:8\r\n\r\n  This frame has 1 object(s):\r\n    [32, 96) 'buf' (line 37) <== Memory access at offset 31 underflows this variable\r\nHINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext\r\n      (longjmp and C++ exceptions *are* supported)\r\nSUMMARY: AddressSanitizer: stack-buffer-underflow /home/vovka/projects/neomutt/mutt/path.c:85:8 in mutt_path_tidy_slash\r\nShadow bytes around the buggy address:\r\n  0x4ffffffffbd0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x4ffffffffbe0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x4ffffffffbf0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x4ffffffffc00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x4ffffffffc10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n=>0x4ffffffffc20: 00 00 00 00 f1 f1 f1[f1]00 00 00 00 00 00 00 00\r\n  0x4ffffffffc30: f3 f3 f3 f3 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x4ffffffffc40: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1\r\n  0x4ffffffffc50: f8 f8 f8 f8 f8 f8 f3 f3 f3 f3 f3 f3 00 00 00 00\r\n  0x4ffffffffc60: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00\r\n  0x4ffffffffc70: 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1\r\nShadow byte legend (one shadow byte represents 8 application bytes):\r\n  Addressable:           00\r\n  Partially addressable: 01 02 03 04 05 06 07\r\n  Heap left redzone:       fa\r\n  Freed heap region:       fd\r\n  Stack left redzone:      f1\r\n  Stack mid redzone:       f2\r\n  Stack right redzone:     f3\r\n  Stack after return:      f5\r\n  Stack use after scope:   f8\r\n  Global redzone:          f9\r\n  Global init order:       f6\r\n  Poisoned by user:        f7\r\n  Container overflow:      fc\r\n  Array cookie:            ac\r\n  Intra object redzone:    bb\r\n  ASan internal:           fe\r\n  Left alloca redzone:     ca\r\n  Right alloca redzone:    cb\r\n==51915==ABORTING\r\nTest test_mutt_path_tidy_dotdot...              [   OK   ]\r\nTest test_mutt_path_tidy...                     [   OK   ]\r\nFAILED: 1 of 13 unit tests have failed.\r\n*** Error code 1\r\n```\r\n\r\n## Steps to Reproduce\r\n\r\n* Configure NeoMutt with AddressSanitizer\r\n* Run tests\r\n\r\n## How often does this happen?\r\n\r\n- Always\r\n\r\n## When did it start to happen?\r\n\r\n- When I upgraded to current master\r\n\r\n## NeoMutt Version\r\n\r\n```\r\nSystem: FreeBSD 12.0-ALPHA2 (amd64)\r\nncurses: ncurses 5.9.20140222 (compiled with 5.9.20140222)\r\nlibiconv: 1.14\r\nGPGme: 1.11.1\r\nhcache backends: tokyocabinet, lmdb\r\n\r\nCompiler:\r\nFreeBSD clang version 6.0.1 (tags/RELEASE_601/final 335540) (based on LLVM 6.0.1)\r\nTarget: x86_64-unknown-freebsd12.0\r\nThread model: posix\r\nInstalledDir: /usr/bin\r\n\r\nConfigure options: --with-ssl=/usr/lib --gpgme --notmuch --lmdb --tokyocabinet --disable-idn --sasl\r\n\r\nCompilation CFLAGS: -pipe -march=native -g -fstack-protector -fno-strict-aliasing -isystem /usr/local/include -fsanitize=address -fno-omit-frame-pointer -std=c99 -D_ALL_SOURCE=1 -D_GNU_SOURCE=1 -D__EXTENSIONS__ -I/usr/local/include -DNCURSES_WIDECHAR -I/usr/lib/include\r\n\r\nDefault options:\r\n  +attach_headers_color +compose_to_sender +compress +cond_date +debug\r\n  +encrypt_to_self +forgotten_attachments +forwref +ifdef +imap +index_color\r\n  +initials +limit_current_thread +multiple_fcc +nested_if +new_mail +nntp +pop\r\n  +progress +quasi_delete +regcomp +reply_with_xorig +sensible_browser +sidebar\r\n  +skip_quoted +smtp +status_color +timeout +tls_sni +trash\r\n\r\nCompile options:\r\n  +bkgdset +color +curs_set +fcntl -flock -fmemopen +futimens +getaddrinfo\r\n  -gnutls +gpgme -gss +hcache -homespool -idn -locales_hack -lua +meta\r\n  -mixmaster +nls +notmuch +openssl +pgp +sasl +smime +start_color\r\n  +sun_attachment +typeahead\r\nMAILPATH=\"/var/mail\"\r\nPKGDATADIR=\"/usr/local/share/neomutt\"\r\nSENDMAIL=\"/usr/sbin/sendmail\"\r\nSYSCONFDIR=\"/usr/local/etc\"\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/neomutt/neomutt/issues/comments/413841684","html_url":"https://github.com/neomutt/neomutt/issues/1315#issuecomment-413841684","issue_url":"https://api.github.com/repos/neomutt/neomutt/issues/1315","id":413841684,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMzg0MTY4NA==","user":{"login":"flatcap","id":76760,"node_id":"MDQ6VXNlcjc2NzYw","avatar_url":"https://avatars3.githubusercontent.com/u/76760?v=4","gravatar_id":"","url":"https://api.github.com/users/flatcap","html_url":"https://github.com/flatcap","followers_url":"https://api.github.com/users/flatcap/followers","following_url":"https://api.github.com/users/flatcap/following{/other_user}","gists_url":"https://api.github.com/users/flatcap/gists{/gist_id}","starred_url":"https://api.github.com/users/flatcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/flatcap/subscriptions","organizations_url":"https://api.github.com/users/flatcap/orgs","repos_url":"https://api.github.com/users/flatcap/repos","events_url":"https://api.github.com/users/flatcap/events{/privacy}","received_events_url":"https://api.github.com/users/flatcap/received_events","type":"User","site_admin":false},"created_at":"2018-08-17T11:52:45Z","updated_at":"2018-08-17T11:52:45Z","author_association":"MEMBER","body":"Good find!  Thanks!"}}
{"actor":{"display_login":"flatcap"}}