xaizek / vifm (License: GPLv2+) (since 2018-12-07)
Vifm is a file manager with curses interface, which provides Vi[m]-like environment for managing objects within file systems, extended with some useful ideas from mutt.
Commit b9167bc584cd3f25a52273f1ed5969b498ca1e39

Fix UBs in filetype.c:make_pivot_{first,last}()
Applying zero offset to null pointer is a UB because it formally
involves dereferencing to produce an lvalue.
Author: xaizek
Author date (UTC): 2025-09-03 18:16
Committer name: xaizek
Committer date (UTC): 2025-09-28 12:59
Parent(s): 6e41b28ea088c785d451c8b646d8ffdae6eec729
Signing key: 99DC5E4DB05F6BE2
Tree: fc9bc49208474b43f1c4165b028a3b3e40eeff97
File Lines added Lines deleted
src/filetype.c 2 4
File src/filetype.c changed (mode: 100644) (index 2c8d98982..c69b565c1)
... ... make_pivot_first(reordering_data_t *d)
354 354 sizeof(d->list[0])); sizeof(d->list[0]));
355 355 d->j += fileviewers.count - d->i; d->j += fileviewers.count - d->i;
356 356
357 mem_cpy(&d->list[d->j], &d->prefix[0], DA_SIZE(d->prefix),
358 sizeof(d->list[0]));
357 mem_cpy(&d->list[d->j], d->prefix, DA_SIZE(d->prefix), sizeof(d->list[0]));
359 358 d->j += DA_SIZE(d->prefix); d->j += DA_SIZE(d->prefix);
360 359
361 360 assert(d->j == fileviewers.count); assert(d->j == fileviewers.count);
 
... ... make_pivot_last(reordering_data_t *d)
419 418 sizeof(d->list[0])); sizeof(d->list[0]));
420 419 d->j += fileviewers.count - d->i; d->j += fileviewers.count - d->i;
421 420
422 mem_cpy(&d->list[d->j], &d->prefix[0], DA_SIZE(d->prefix),
423 sizeof(d->prefix[0]));
421 mem_cpy(&d->list[d->j], d->prefix, DA_SIZE(d->prefix), sizeof(d->prefix[0]));
424 422 d->j += DA_SIZE(d->prefix); d->j += DA_SIZE(d->prefix);
425 423
426 424 free(fileviewers.list); free(fileviewers.list);
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/vifm

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/vifm

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master