git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git column fails (or crashes) if padding is negative
@ 2024-02-09 14:21 Tiago Pascoal
  2024-02-09 16:27 ` Kristoffer Haugsbakk
  2024-02-09 17:52 ` [PATCH] column: disallow negative padding Kristoffer Haugsbakk
  0 siblings, 2 replies; 32+ messages in thread
From: Tiago Pascoal @ 2024-02-09 14:21 UTC (permalink / raw)
  To: git@vger.kernel.org

Thank you for filling out a Git bug report!
Please answer the following questions to help us understand your issue.

What did you do before the bug happened? (Steps to reproduce your issue)

Call git column with a negative padding value, e.g. `git column --padding -1`

If the number if bigger than -3, the command will fail with the following error message:

  Floating point exception

If the number is -5 or greater, the command will fail with the following error message:

  fatal: Out of memory, malloc failed (tried to allocate 18446744073709551615 bytes)

eg:
$ seq 1 100 | git column --mode=column  --padding=-5
fatal: Out of memory, malloc failed (tried to allocate 18446744073709551615 bytes)

What did you expect to happen? (Expected behavior)

An error message indicating that the padding value is invalid and not a crash.

What happened instead? (Actual behavior)

Failed command or even an OOM error depending on the padding value.

What's different between what you expected and what actually happened?

Anything else you want to add:


[System Info]
git version:
git version 2.34.1
cpu: x86_64
no commit associated with this build
sizeof-long: 8
sizeof-size_t: 8
shell-path: /bin/sh
uname: Linux 5.15.133.1-microsoft-standard-WSL2 #1 SMP Thu Oct 5 21:02:42 UTC 2023 x86_64
compiler info: gnuc: 11.4
libc info: glibc: 2.35
$SHELL (typically, interactive shell): /bin/bash


[Enabled Hooks]
not run from a git repository - no hooks to show

^ permalink raw reply	[flat|nested] 32+ messages in thread

end of thread, other threads:[~2024-02-14  1:35 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-09 14:21 git column fails (or crashes) if padding is negative Tiago Pascoal
2024-02-09 16:27 ` Kristoffer Haugsbakk
2024-02-09 17:57   ` Junio C Hamano
2024-02-11 17:08     ` Kristoffer Haugsbakk
2024-02-12 16:37       ` Junio C Hamano
2024-02-09 17:52 ` [PATCH] column: disallow negative padding Kristoffer Haugsbakk
2024-02-09 18:26   ` Kristoffer Haugsbakk
2024-02-10  9:48     ` Chris Torek
2024-02-11 17:10       ` Kristoffer Haugsbakk
2024-02-11 17:55         ` Junio C Hamano
2024-02-11 18:18           ` Kristoffer Haugsbakk
2024-02-11 19:27   ` [PATCH v2] " Kristoffer Haugsbakk
2024-02-11 22:47     ` Rubén Justo
2024-02-11 23:50       ` Rubén Justo
2024-02-12  7:05       ` Kristoffer Haugsbakk
2024-02-12 16:50       ` Kristoffer Haugsbakk
2024-02-12 21:28         ` Rubén Justo
2024-02-13 16:01     ` [PATCH v3 0/2] " Kristoffer Haugsbakk
2024-02-13 16:01       ` [PATCH v3 1/2] " Kristoffer Haugsbakk
2024-02-13 16:01       ` [PATCH v3 2/2] column: guard against " Kristoffer Haugsbakk
2024-02-13 17:06         ` Junio C Hamano
2024-02-13 18:39           ` Rubén Justo
2024-02-13 19:39             ` Junio C Hamano
2024-02-13 19:56               ` Rubén Justo
2024-02-13 20:35                 ` Kristoffer Haugsbakk
2024-02-13 20:59                   ` Junio C Hamano
2024-02-13 23:25               ` Rubén Justo
2024-02-13 23:36                 ` [PATCH] tag: error when git-column fails Rubén Justo
2024-02-14  1:35                   ` Junio C Hamano
2024-02-13 19:27       ` [PATCH v3 0/2] column: disallow negative padding Rubén Justo
2024-02-13 20:32         ` Kristoffer Haugsbakk
2024-02-13 20:58           ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).