From: Michal J. <mi...@ha...> - 2004-07-05 21:46:38
|
On Mon, Jul 05, 2004 at 02:15:32PM -0600, Michal Jaegermann wrote: > On Thu, Jun 17, 2004 at 10:10:19AM -0600, Kevin Russell wrote: > > > > The following test would be better: > > > > r = getxattr(path, BPROC_STATE_XATTR, info->status, sizeof(info->status)); > > if (r < 0 || r > sizeof(info->status)){ > > errno = BE_INVALIDNODE; > > return -1; > > } > > > > r = getxattr(path, BPROC_ADDR_XATTR, info->status, sizeof(info->addr)); > > if (r < 0 || r > sizeof(info->status)){ > ^^^^ > > errno = BE_INVALIDNODE; > > return -1; > > } > > Should that be in the second case 'sizeof(info->status)' or rather > 'sizeof(info->addr)'? As a matter of fact it seems to me now that both 'info->status' in the second group should be 'info->addr'. Otherwise what we got into 'info->status' on the first 'getxattr()' call will be overwritten if the second call succeeds. Am I missing something? Michal |