Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 37668 Details for
Bug 15835
lsraid segfaults
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixes a few issues with previous patch.
longline-fix-2.patch (text/plain), 1.39 KB, created by
Adam Hixson
on 2004-08-18 09:29:48 UTC
(
hide
)
Description:
Fixes a few issues with previous patch.
Filename:
MIME Type:
Creator:
Adam Hixson
Created:
2004-08-18 09:29:48 UTC
Size:
1.39 KB
patch
obsolete
>--- lsraid.c.orig 2004-08-18 11:04:44.119778304 -0500 >+++ lsraid.c 2004-08-18 11:06:47.026093704 -0500 >@@ -1032,8 +1032,8 @@ > FILE *proc; > int major, minor, rc; > char name[MAX_LINE_LENGTH]; >- char *line = malloc(MAX_LINE_LENGTH); >- char *current_read = malloc(MAX_LINE_LENGTH); >+ char *line = malloc(MAX_LINE_LENGTH*sizeof(char)); >+ char *current_read = malloc(MAX_LINE_LENGTH*sizeof(char)); > struct stat stat_buf; > > if (!ctxt || !ctxt->devtable) >@@ -1054,14 +1054,17 @@ > if ((fgets(current_read, MAX_LINE_LENGTH, proc)) == NULL) > goto out; > strcpy(line, (const char*) current_read); >- >- while (strlen(current_read) == (MAX_LINE_LENGTH-1)) >+ >+ while (strlen(current_read) == (MAX_LINE_LENGTH-1)) > { >- int old_length = strlen(line); >- line = realloc(line, old_length + MAX_LINE_LENGTH); >- if ((fgets(current_read, MAX_LINE_LENGTH, proc)) == NULL) >+ if (current_read[MAX_LINE_LENGTH - 2] != '\n') { >+ int old_length = strlen(line); >+ line = realloc(line, old_length + MAX_LINE_LENGTH); >+ if ((fgets(current_read, MAX_LINE_LENGTH, proc)) == NULL) > goto out; >- strcpy(line + old_length, current_read); >+ strcpy(line + old_length, current_read); >+ } /* if (current_read....*/ >+ else break; > } > > name[0] = 0;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 15835
:
37546
|
37610
| 37668