Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: sysdeps/nacl/sysdep.h

Issue 759833008: NaCl: Fix off-by-one in getcwd() syscall emulation. (Closed) Base URL: http://git.chromium.org/native_client/nacl-glibc.git@master
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sysdeps/nacl/sysdep.h
diff --git a/sysdeps/nacl/sysdep.h b/sysdeps/nacl/sysdep.h
index 2e2b8b09bd908bccc50e9d42a2845249896d1a2c..cc47fab815036662c59b6146ec83302045931db9 100644
--- a/sysdeps/nacl/sysdep.h
+++ b/sysdeps/nacl/sysdep.h
@@ -598,8 +598,8 @@ INTERNAL_SYSCALL_getcwd_2 (int *err, char *buf, size_t size)
if (*err) {
return 0;
}
- for (len = 0; len < size && buf[len] != '\0'; ++len);
- return len;
+ for (len = 0; buf[len] != '\0'; ++len);
Roland McGrath 2014/12/08 20:56:48 Why is it safe to presume it's terminated and not
Sam Clegg 2014/12/08 21:10:29 Because the __nacl_irt_getcwd will fail if it coul
Sam Clegg 2014/12/08 22:38:39 Ok. Done. Although in the case when __nacl_irt_ge
+ return len + 1;
}
__extern_always_inline gid_t
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698