[Feature][ZXW-265]merge P56U03 version
Only Configure: No
Affected branch: master
Affected module: unknow
Is it affected on both ZXIC and MTK: only ZXIC
Self-test: Yes
Doc Update: No
Change-Id: I873f6df64e2605a77b8b8bfec35b21e7f33c5444
diff --git a/ap/libc/glibc/glibc-2.23/sysdeps/posix/getcwd.c b/ap/libc/glibc/glibc-2.23/sysdeps/posix/getcwd.c
old mode 100644
new mode 100755
index 38cf4e7..23e77cd
--- a/ap/libc/glibc/glibc-2.23/sysdeps/posix/getcwd.c
+++ b/ap/libc/glibc/glibc-2.23/sysdeps/posix/getcwd.c
@@ -241,6 +241,13 @@
char *path;
#ifndef NO_ALLOCATION
size_t allocated = size;
+
+ /* A size of 1 byte is never useful. */
+ if (allocated == 1)
+ {
+ __set_errno (ERANGE);
+ return NULL;
+ }
if (size == 0)
{
if (buf != NULL)