Skip to content

Segfault while reading .editorconfig generated by JetBrains IDE  #73

Description

@vovochka404

I've got segfault of Kate each time i'm trying to open any file in directory with .editorconfig, generated by JetBrains IDE

vovochka in ~/tmp $ ls -a  
.  ..  .editorconfig  test.php
vovochka in ~/tmp $ editorconfig /home/vovochka/tmp/test.php 
*** buffer overflow detected ***: editorconfig terminated
[1]    77219 abort (core dumped)  editorconfig /home/vovochka/tmp/test.php

.editorconfig:
editorconfig.txt

Got this trace:

#0  __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007f3113b36b01 in __GI_abort () at abort.c:79
#2  0x00007f3113b78957 in __libc_message (action=<optimized out>, fmt=fmt@entry=0x7f3113c800f3 "*** %s ***: %s terminated\n") at ../sysdeps/posix/libc_fatal.c:181
#3  0x00007f3113c0954e in __GI___fortify_fail_abort (need_backtrace=need_backtrace@entry=true, msg=msg@entry=0x7f3113c8007a "buffer overflow detected") at fortify_fail.c:33
#4  0x00007f3113c09581 in __GI___fortify_fail (msg=msg@entry=0x7f3113c8007a "buffer overflow detected") at fortify_fail.c:44
#5  0x00007f3113c07430 in __GI___chk_fail () at chk_fail.c:28
#6  0x00007f3113c066c2 in __strcpy_chk (dest=dest@entry=0x7ffda5967b90 "ij_php_api_weight", src=0x7ffda5968cf0 "ij_php_array_initializer_new_line_after_left_brace", destlen=destlen@entry=50) at strcpy_chk.c:30
#7  0x00007f3113eb9352 in strcpy (__src=<optimized out>, __dest=0x7ffda5967b90 "ij_php_api_weight") at /usr/include/bits/string_fortified.h:90
#8  array_editorconfig_name_value_add (aenv=aenv@entry=0x7ffda596a140, name=name@entry=0x7ffda5968cf0 "ij_php_array_initializer_new_line_after_left_brace", value=value@entry=0x7ffda5968d25 "true")
    at /usr/src/debug/editorconfig-core-c-0.12.3-lp152.1.5.x86_64/src/lib/editorconfig.c:156
#9  0x00007f3113eb96d3 in ini_handler (hfp=hfp@entry=0x7ffda596a130, section=section@entry=0x7ffda5967ce0 "{*.ctp,*.phtml,*.module,*.php,*.php5,*.php4,*.hphp,*.inc}", 
    name=name@entry=0x7ffda5968cf0 "ij_php_array_initializer_new_line_after_left_brace", value=value@entry=0x7ffda5968d25 "true") at /usr/src/debug/editorconfig-core-c-0.12.3-lp152.1.5.x86_64/src/lib/editorconfig.c:269
#10 0x00007f3113eba1a6 in ini_parse_file (file=file@entry=0x5594ed38c410, handler=handler@entry=0x7f3113eb9510 <ini_handler>, user=user@entry=0x7ffda596a130) at /usr/src/debug/editorconfig-core-c-0.12.3-lp152.1.5.x86_64/src/lib/ini.c:180
#11 0x00007f3113eba34c in ini_parse (filename=filename@entry=0x5594ed38c350 "/home/vovochka/tmp/.editorconfig", handler=handler@entry=0x7f3113eb9510 <ini_handler>, user=user@entry=0x7ffda596a130)
    at /usr/src/debug/editorconfig-core-c-0.12.3-lp152.1.5.x86_64/src/lib/ini.c:205
#12 0x00007f3113eb9ad5 in editorconfig_parse (full_filename=<optimized out>, h=0x5594ed38c2b0) at /usr/src/debug/editorconfig-core-c-0.12.3-lp152.1.5.x86_64/src/lib/editorconfig.c:470
#13 0x00005594eb29e4e8 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/editorconfig-core-c-0.12.3-lp152.1.5.x86_64/src/bin/main.c:219

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions