Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F177836131
D60776.1795395417.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
864 B
Referenced Files
None
Subscribers
None
D60776.1795395417.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D60776: crypt_des: fail if salt/session is too short
Attached
Detach File
Event Timeline