summaryrefslogtreecommitdiff
path: root/libc/system_properties/context_node.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libc/system_properties/context_node.cpp')
-rw-r--r--libc/system_properties/context_node.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/libc/system_properties/context_node.cpp b/libc/system_properties/context_node.cpp
index 5496b5a9a..d392c0ad5 100644
--- a/libc/system_properties/context_node.cpp
+++ b/libc/system_properties/context_node.cpp
@@ -51,7 +51,7 @@ bool ContextNode::Open(bool access_rw, bool* fsetxattr_failed) {
char filename[PROP_FILENAME_MAX];
int len = async_safe_format_buffer(filename, sizeof(filename), "%s/%s", filename_, context_);
- if (len < 0 || len > PROP_FILENAME_MAX) {
+ if (len < 0 || len >= PROP_FILENAME_MAX) {
lock_.unlock();
return false;
}
@@ -86,7 +86,7 @@ void ContextNode::ResetAccess() {
bool ContextNode::CheckAccess() {
char filename[PROP_FILENAME_MAX];
int len = async_safe_format_buffer(filename, sizeof(filename), "%s/%s", filename_, context_);
- if (len < 0 || len > PROP_FILENAME_MAX) {
+ if (len < 0 || len >= PROP_FILENAME_MAX) {
return false;
}