lkml.org 
[lkml]   [2001]   [Jun]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] symlink.c
this patch adds a check to make sure memory was allocated, returns an
error code otherwise.
-john

--- fs/autofs4/symlink.c.orig Fri Apr 21 14:41:36 2000
+++ fs/autofs4/symlink.c Sun Jun 3 00:43:18 2001
@@ -15,13 +15,15 @@
static int autofs4_readlink(struct dentry *dentry, char *buffer, int
buflen)
{
struct autofs_info *ino = autofs4_dentry_ino(dentry);
-
return vfs_readlink(dentry, buffer, buflen, ino->u.symlink);
}

static int autofs4_follow_link(struct dentry *dentry, struct nameidata
*nd)
{
struct autofs_info *ino = autofs4_dentry_ino(dentry);
+
+ if(!ino)
+ return -ENOMEM;

return vfs_follow_link(nd, ino->u.symlink);
}

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:55    [W:0.033 / U:0.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site