projects
/
oweals
/
busybox.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[oweals/busybox.git]
/
libbb
/
xreadlink.c
diff --git
a/libbb/xreadlink.c
b/libbb/xreadlink.c
index 66f63b8838cfa4d47bb443f4f1d2d3687d1a3cff..932e487a59d718093cb29f9d4967d8dc504772e8 100644
(file)
--- a/
libbb/xreadlink.c
+++ b/
libbb/xreadlink.c
@@
-1,5
+1,6
@@
/*
/*
- * xreadlink.c - safe implementation of readlink
+ * xreadlink.c - safe implementation of readlink.
+ * Returns a NULL on failure...
*/
#include <stdio.h>
*/
#include <stdio.h>
@@
-22,8
+23,10
@@
extern char *xreadlink(const char *path)
do {
buf = xrealloc(buf, bufsize += GROWBY);
readsize = readlink(path, buf, bufsize); /* 1st try */
do {
buf = xrealloc(buf, bufsize += GROWBY);
readsize = readlink(path, buf, bufsize); /* 1st try */
- if (readsize == -1)
- perror_msg("%s:%s", applet_name, path);
+ if (readsize == -1) {
+ perror_msg("%s:%s", applet_name, path);
+ return NULL;
+ }
}
while (bufsize < readsize + 1);
}
while (bufsize < readsize + 1);