Reject partial or overflowing user ids (#168)

Co-authored-by: HttpAnimations <shawndouglasyt@gmail.com>
This commit is contained in:
珍惜andHttpAnimations authored and GitHub committed 2026-09-25 18:37:33 +03:00
1 parent 30d50f15d1
commit 2eef4f966f
1 file changed
+5 -1
+5 -1
View File
@@ -1581,9 +1581,13 @@ jlong ParseLocalStorageUserIdFromEnv() {
if (!value || value[0] == '\0') {
return 0;
}
errno = 0;
char* end = nullptr;
long long parsed = std::strtoll(value, &end, 10);
return end == value ? 0 : static_cast<jlong>(parsed);
if (errno == ERANGE || end == value || *end != '\0') {
return 0;
}
return static_cast<jlong>(parsed);
}
jlong CurrentLocalStorageUserLocked() {