| To: | Alex Elder <aelder@xxxxxxx> |
|---|---|
| Subject: | Re: [PATCH 1/5] xfsprogs: libxcmd: don't clobber fs_table on realloc() |
| From: | Christoph Hellwig <hch@xxxxxxxxxxxxx> |
| Date: | Wed, 28 Sep 2011 20:59:46 -0400 |
| Cc: | xfs@xxxxxxxxxxx |
| In-reply-to: | <08dbe8c3d0f49bac0c18570a68e7aa983cb4c731.1317207144.git.aelder@xxxxxxx> |
| References: | <1317207432-8464-1-git-send-email-aelder@xxxxxxx> <08dbe8c3d0f49bac0c18570a68e7aa983cb4c731.1317207144.git.aelder@xxxxxxx> |
| User-agent: | Mutt/1.5.21 (2010-09-15) |
On Wed, Sep 28, 2011 at 05:57:08AM -0500, Alex Elder wrote: > In fs_table_insert(), realloc() is called to resize the global > fs_table. If it fails, it overwrites a previously valid fs_table > pointer with NULL. > > Instead, assign the return value to a local temporary and overwrite > fs_table only if the realloc() call succeeds. The only defined > errno value for a realloc() failure is ENOMEM, so return that > explicitly in the event it fails. Looks good. Did you encounter this issue in real life? Reviewed-by: Christoph Hellwig <hch@xxxxxx> |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | Re: 64-bit inodes and back again, Michael Cronenworth |
|---|---|
| Next by Date: | Re: [PATCH 2/5] xfsprogs: libxcmd: simplify fs_table_lookup(), Christoph Hellwig |
| Previous by Thread: | Re: [PATCH 5/5] xfsprogs: libxcmd: use fs_device_number() consistently, Christoph Hellwig |
| Next by Thread: | Re: [PATCH 1/5] xfsprogs: libxcmd: don't clobber fs_table on realloc(), Alex Elder |
| Indexes: | [Date] [Thread] [Top] [All Lists] |