← Commit list

152454061

Denys Vlasenko
Denys Vlasenko
2025-07-06
SOURCE BUG Duration: 112s

Subject

libbb/yescrypt: remove unused variable

SOURCE BUG

This commit was genuinely broken at the time (not related to our build system): libbb/yescrypt eklenirken (2025-07-06 - 2025-07-07 arasi) once unutulan kaynak dosyalari (pw_encrypt_yes.c, hash_sha256_block.c, pw_ascii64.c), ardindan 64-bit'te derlenmeyen bir 'buflen' degiskeni (alg-yescrypt-kdf.c) vardi - busybox'in kendi kodundaki gercek hatalar (e5d3a8763 ile duzeltildi)

→ Bu hatanin tam hikayesini ve duzeltme diffini gor

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libbb/yescrypt/alg-yescrypt-common.c+3 -8
@@ -182,8 +182,7 @@ uint8_t *yescrypt_r(
uint8_t *buf, size_t buflen)
{
unsigned char saltbin[64], hashbin[32];
- const uint8_t *src, *saltstr, *salt;
- const uint8_t *saltend;
+ const uint8_t *src, *saltstr, *saltend;
uint8_t *dst;
size_t need, prefixlen, saltstrlen, saltlen;
uint32_t flavor, N_log2;
@@ -265,19 +264,15 @@ uint8_t *yescrypt_r(
if (!saltend || (size_t)(saltend - saltstr) != saltstrlen)
goto fail;
- salt = saltbin;
-
need = prefixlen + saltstrlen + 1 + HASH_LEN + 1;
if (need > buflen || need < saltstrlen)
goto fail;
- if (yescrypt_kdf(local, passwd, passwdlen, salt, saltlen,
+ if (yescrypt_kdf(local, passwd, passwdlen, saltbin, saltlen,
&params, hashbin, sizeof(hashbin)))
goto fail;
- dst = buf;
- memcpy(dst, setting, prefixlen + saltstrlen);
- dst += prefixlen + saltstrlen;
+ dst = mempcpy(buf, setting, prefixlen + saltstrlen);
*dst++ = '$';
dst = encode64(dst, buflen - (dst - buf), hashbin, sizeof(hashbin));