Page MenuHomeFreeBSD

D60776.1795395417.diff
No OneTemporary

Authored By
Unknown
Size
864 B
Referenced Files
None
Subscribers
None

D60776.1795395417.diff

diff --git a/secure/lib/libcrypt/crypt-des.c b/secure/lib/libcrypt/crypt-des.c
--- a/secure/lib/libcrypt/crypt-des.c
+++ b/secure/lib/libcrypt/crypt-des.c
@@ -614,6 +614,16 @@
* setting - underscore, 4 bytes of count, 4 bytes of salt
* key - unlimited characters
*/
+
+ /*
+ * NB: this function expects `setting` to contain 9 bytes and
+ * reads from them unconditionally. Fail if there are not at
+ * least 9 non-NUL bytes to avoid out-of-bounds reads if
+ * underlength values are passed.
+ */
+ if (strnlen(setting, 9) < 9)
+ return (-1);
+
for (i = 1, count = 0L; i < 5; i++)
count |= ascii_to_bin(setting[i]) << ((i - 1) * 6);
@@ -643,6 +653,9 @@
* setting - 2 bytes of salt
* key - up to 8 characters
*/
+ if (setting[0] == '\0')
+ return (-1);
+
count = 25;
salt = (ascii_to_bin(setting[1]) << 6)

File Metadata

Mime Type
text/plain
Expires
Mon, Nov 23, 12:56 AM (12 h, 45 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41102434
Default Alt Text
D60776.1795395417.diff (864 B)

Event Timeline