Fix utime/utimes when passed a NULL pointer.

Bug: 11383777
Change-Id: If944a42f3adfa8a6ce91c167c249e009ed63300a
This commit is contained in:
Elliott Hughes
2013-10-28 13:21:06 -07:00
parent d4e9f076d6
commit 27586ebe1a
3 changed files with 18 additions and 6 deletions

View File

@@ -19,6 +19,8 @@
#include <errno.h>
#include <sys/time.h>
#include "TemporaryFile.h"
TEST(sys_time, utimes) {
timeval tv[2];
memset(&tv, 0, sizeof(tv));
@@ -38,3 +40,9 @@ TEST(sys_time, utimes) {
ASSERT_EQ(-1, utimes("/", tv));
ASSERT_EQ(EINVAL, errno);
}
// http://b/11383777
TEST(sys_time, utimes_NULL) {
TemporaryFile tf;
ASSERT_EQ(0, utimes(tf.filename, NULL));
}