Skip to content

Commit

Permalink
Merge pull request #5 from Bilb/fix-joined_at-too-far
Browse files Browse the repository at this point in the history
fix: limit joined_at to seconds up to 01/01/2100
  • Loading branch information
Bilb authored Dec 16, 2024
2 parents b3b1b21 + 328f774 commit e11c1b6
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,6 @@ jobs:
uses: microsoft/[email protected]
if: runner.os == 'Windows'

- name: Setup node for windows
if: runner.os == 'Windows'
shell: bash
run: |
yarn global add node-gyp@latest
# - name: sed it
# if: runner.os == 'Windows'
# shell: bash
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"main": "index.js",
"name": "libsession_util_nodejs",
"description": "Wrappers for the Session Util Library",
"version": "0.4.7",
"version": "0.4.8",
"license": "GPL-3.0",
"author": {
"name": "Oxen Project",
Expand Down
4 changes: 4 additions & 0 deletions src/user_groups_config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,10 @@ Napi::Value UserGroupsWrapper::setGroup(const Napi::CallbackInfo& info) {
obj.Get("joinedAtSeconds"), "UserGroupsWrapper::setGroup joinedAtSeconds")) {
group_info.joined_at = *joinedAtSeconds;
}
// Probably an invalid timestamp.
if (group_info.joined_at > 9000000000) {
throw std::invalid_argument{"group.joined_at is too far in the future"};
}

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

0 comments on commit e11c1b6

Please sign in to comment.