Skip to content

Commit e11c1b6

Browse files
authored
Merge pull request #5 from Bilb/fix-joined_at-too-far
fix: limit joined_at to seconds up to 01/01/2100
2 parents b3b1b21 + 328f774 commit e11c1b6

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

.github/workflows/test.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ jobs:
4444
uses: microsoft/[email protected]
4545
if: runner.os == 'Windows'
4646

47-
- name: Setup node for windows
48-
if: runner.os == 'Windows'
49-
shell: bash
50-
run: |
51-
yarn global add node-gyp@latest
52-
5347
# - name: sed it
5448
# if: runner.os == 'Windows'
5549
# shell: bash

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"main": "index.js",
33
"name": "libsession_util_nodejs",
44
"description": "Wrappers for the Session Util Library",
5-
"version": "0.4.7",
5+
"version": "0.4.8",
66
"license": "GPL-3.0",
77
"author": {
88
"name": "Oxen Project",

src/user_groups_config.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ Napi::Value UserGroupsWrapper::setGroup(const Napi::CallbackInfo& info) {
314314
obj.Get("joinedAtSeconds"), "UserGroupsWrapper::setGroup joinedAtSeconds")) {
315315
group_info.joined_at = *joinedAtSeconds;
316316
}
317+
// Probably an invalid timestamp.
318+
if (group_info.joined_at > 9000000000) {
319+
throw std::invalid_argument{"group.joined_at is too far in the future"};
320+
}
317321

318322
if (auto invited = maybeNonemptyBoolean(
319323
obj.Get("invitePending"), "UserGroupsWrapper::setGroup invitePending")) {

0 commit comments

Comments
 (0)