Git segfaults with diff.external and comparing files with different permissions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi folks

It looks like git crashes if diff.external is set and the user
compares files that have different permissions. Here's a repro:

$ mkdir demo
$ cd demo
$ git init .
Initialized empty Git repository in /tmp/demo/.git/

$ git config diff.external /bin/echo
$ touch foo bar
$ chmod 755 foo
$ git diff --no-ext-diff --no-index foo bar
diff --git 1/foo 2/bar
old mode 100755
new mode 100644

$ git diff --no-index foo bar
zsh: segmentation fault (core dumped)  git diff --no-index foo bar

This was originally reported as a difftastic bug[1] but it seems to
occur regardless of the value of diff.external, hence my repro with
/bin/echo.

[1] https://github.com/Wilfred/difftastic/issues/615

[System Info]
git version:
git version 2.43.0
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 6.7.0-zen3-1-zen #1 ZEN SMP PREEMPT_DYNAMIC Sat, 13 Jan
2024 14:36:54 +0000 x86_64
compiler info: gnuc: 13.2
libc info: glibc: 2.38
$SHELL (typically, interactive shell): /bin/zsh

Thanks
Wilfred




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux