Bugzilla – Attachment 71568 Details for
Bug 155746
attr package: possible segfault in attr_list
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
Patch from SGI
xfs-cmds-25263a-fix-list_attr-segfault (text/plain), 2.67 KB, created by
Andreas Gruenbacher
on 2006-03-07 14:38:09 UTC
(
hide
)
Description:
Patch from SGI
Filename:
MIME Type:
Creator:
Andreas Gruenbacher
Created:
2006-03-07 14:38:09 UTC
Size:
2.67 KB
patch
obsolete
>Date: Wed, Feb 22 2006 13:56:35 +1100 >From: Nathan Scott <nathans@sgi.com> >References: SGI:PV949977 >Subject: fix list_attr segfault > >Fix a possible segfault from the attr list compat interfaces, >thanks to Simon Munton. > >=========================================================================== >Index: attr/libattr/libattr.c >=========================================================================== > >--- a/attr/libattr/libattr.c 2006-02-22 13:28:37.000000000 +1100 >+++ b/attr/libattr/libattr.c 2006-02-22 13:28:37.000000000 +1100 >@@ -268,7 +268,7 @@ attr_list(const char *path, char *buffer > attrlist_cursor_t *cursor) > { > const char *l; >- int length, count = 0; >+ int length, vlength, count = 0; > char lbuf[MAXLISTLEN]; > char name[MAXNAMELEN+16]; > unsigned int start_offset, end_offset; >@@ -293,14 +293,14 @@ attr_list(const char *path, char *buffer > if (api_unconvert(name, l, flags)) > continue; > if (flags & ATTR_DONTFOLLOW) >- length = lgetxattr(path, l, NULL, 0); >+ vlength = lgetxattr(path, l, NULL, 0); > else >- length = getxattr(path, l, NULL, 0); >- if (length < 0 && (errno == ENOATTR || errno == ENOTSUP)) >+ vlength = getxattr(path, l, NULL, 0); >+ if (vlength < 0 && (errno == ENOATTR || errno == ENOTSUP)) > continue; > if (count++ < cursor->opaque[0]) > continue; >- if (attr_list_pack(name, length, buffer, buffersize, >+ if (attr_list_pack(name, vlength, buffer, buffersize, > &start_offset, &end_offset)) { > cursor->opaque[0] = count; > break; >@@ -314,7 +314,7 @@ attr_listf(int fd, char *buffer, const i > attrlist_cursor_t *cursor) > { > const char *l; >- int c, count = 0; >+ int length, vlength, count = 0; > char lbuf[MAXLISTLEN]; > char name[MAXNAMELEN+16]; > unsigned int start_offset, end_offset; >@@ -325,22 +325,22 @@ attr_listf(int fd, char *buffer, const i > } > bzero(buffer, sizeof(attrlist_t)); > >- c = flistxattr(fd, lbuf, sizeof(lbuf)); >- if (c < 0) >- return c; >+ length = flistxattr(fd, lbuf, sizeof(lbuf)); >+ if (length < 0) >+ return length; > > start_offset = sizeof(attrlist_t); > end_offset = buffersize & ~(8-1); /* 8 byte align */ > >- for (l = lbuf; l != lbuf + c; l = strchr(l, '\0') + 1) { >+ for (l = lbuf; l != lbuf + length; l = strchr(l, '\0') + 1) { > if (api_unconvert(name, l, flags)) > continue; >- c = fgetxattr(fd, l, NULL, 0); >- if (c < 0 && (errno == ENOATTR || errno == ENOTSUP)) >+ vlength = fgetxattr(fd, l, NULL, 0); >+ if (vlength < 0 && (errno == ENOATTR || errno == ENOTSUP)) > continue; > if (count++ < cursor->opaque[0]) > continue; >- if (attr_list_pack(name, c, buffer, buffersize, >+ if (attr_list_pack(name, vlength, buffer, buffersize, > &start_offset, &end_offset)) { > cursor->opaque[0] = count; > break;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 155746
: 71568