Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F148073050
D53129.id164280.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
581 B
Referenced Files
None
Subscribers
None
D53129.id164280.diff
View Options
diff --git a/usr.sbin/quot/quot.c b/usr.sbin/quot/quot.c
--- a/usr.sbin/quot/quot.c
+++ b/usr.sbin/quot/quot.c
@@ -280,14 +280,10 @@
usr--) {
if (!usr->name) {
usr->uid = uid;
-
if (!(pwd = getpwuid(uid))) {
- if ((usr->name = (char *)malloc(7)))
- sprintf(usr->name,"#%d",uid);
+ asprintf(&usr->name, "#%u", uid);
} else {
- if ((usr->name = (char *)
- malloc(strlen(pwd->pw_name) + 1)))
- strcpy(usr->name,pwd->pw_name);
+ usr->name = strdup(pwd->pw_name);
}
if (!usr->name)
errx(1, "allocate users");
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Mar 16, 2:00 PM (28 m, 20 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29752152
Default Alt Text
D53129.id164280.diff (581 B)
Attached To
Mode
D53129: quot: Fix benign buffer overflow
Attached
Detach File
Event Timeline
Log In to Comment