1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-21 14:08:21 +00:00
Commit Graph

12 Commits

Author SHA1 Message Date
Kuan-Wei Chiu
4af26080b8 Fix incorrect comparison result in sort_by_src_len()
The original sort_by_src_len() function returned 0 even when a > b,
violating the C standard requirements for qsort() comparison functions.
Specifically, it broke antisymmetry and transitivity, which can result
in undefined behavior.

In some versions of glibc, this leads not only to incorrect sorting but
also potential memory corruption[1].

Fix the issue by returning -1 when a > b, restoring compliance with the
standard.

Link: https://www.qualys.com/2024/01/30/qsort.txt [1]
Fixes: 8eb2558a7 ("Add -m 6211 module and moved some code around")
2025-06-17 21:26:13 +08:00
Jens Steube
5015bc0d2e Module Parser: Renamed struct token_t to hc_token_t to avoid naming conflict with token_t on MacOS 2021-12-20 13:19:40 +01:00
Jens Steube
97c9e86d15 Filehandling: Print a truncation warning in case an oversized line was detected 2019-08-06 12:22:24 +02:00
Gabriele Gristina
cdbef854a4 (keyboard_layout) remove unused *rc* vars, change free with hcfree 2019-07-13 07:32:15 +02:00
Gabriele Gristina
4b871646fe fix some memory leaks 2019-07-10 17:27:45 +02:00
Gabriele Gristina
3161aec3da fix the comments :) 2019-07-01 17:27:08 +02:00
Gabriele Gristina
5679ca3344 Rewrite hc_fopen to better handling file descriptor locking/unlocking functions, saving kernels binary from plain to gzip format 2019-07-01 01:30:24 +02:00
Gabriele Gristina
398c89c75c switch almost all FILE ops, potfile is the only missing 2019-06-26 19:06:46 +02:00
Gabriele Gristina
b2529af172 remove original commented code 2019-06-22 15:00:50 +02:00
Gabriele Gristina
6cb4abd526 Add zlib support v2 2019-06-21 21:56:38 +02:00
jsteube
a59d1c17eb Fix function declaration for execute_keyboard_layout_mapping() 2019-02-07 17:15:45 +01:00
jsteube
8eb2558a7e Add -m 6211 module and moved some code around 2019-01-26 16:54:29 +01:00