mirror of
https://github.com/InstanceBrick/nightcap.git
synced 2026-10-23 08:01:53 +02:00
Reject partial or overflowing user ids (#168)
Co-authored-by: HttpAnimations <shawndouglasyt@gmail.com>
This commit is contained in:
1 parent
30d50f15d1
commit
2eef4f966f
1 file changed
+5
-1
+5
-1
@@ -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() {
|
||||
|
||||
Reference in new issue
Block a user