Fix utime/utimes when passed a NULL pointer.
Bug: 11383777 Change-Id: If944a42f3adfa8a6ce91c167c249e009ed63300a
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
Reference in New Issue
Block a user