Skip to content
Snippets Groups Projects
  1. Aug 10, 2022
  2. Aug 04, 2022
  3. Aug 03, 2022
    • Rob Swindell's avatar
      Check max_files value in extract_files_from_archive() better · 5a441656
      Rob Swindell authored
      Address issue reported by Nightfox via DOVE-Net:
      Today I was using the Archive class to extract exactly one file from a zip
      file, and I'm a little confused on the exception throwing behavior regarding
      the max_files parameter.  When calling extract(), I gave it a filename pattern
      and expected exactly 1 file to be extracted, so I also gave a max_files
      argument as 1.  It extracted the one file, but it threw an exception with the
      error "Error: maximum number of files (1) extracted (after extracting 1 item
      successfully)".
      
      Should that be an error condition to throw an exception? I expected 1 file to
      be extracted, and that file was extracted successfully.  If I specify max_files
      as 2, then it doesn't throw an exception.   
      5a441656
  4. Jul 10, 2022
  5. Jul 08, 2022
  6. Jul 07, 2022
  7. Jul 05, 2022
  8. Jul 04, 2022
  9. Jul 03, 2022
    • Rob Swindell's avatar
      Paranoia around use of smb.subnum as an index into scfg.sub[] · b8035cae
      Rob Swindell authored
      Use the is_valid_subnum() function before using the smb.subnum as an index into (s)cfg.sub[]. Related to the previous committed fix of writemsg(): leaving the global smb.subnum as -1 (INVALID_SUB) after replying to a post via email or netmail, resulting in a crash here.
      b8035cae
    • Rob Swindell's avatar
      Fix smb.subnum corruption in writemsg() · 3da1fa6c
      Rob Swindell authored
      Fix issue introduced 9 years ago that could cause a crash after replying to a post via email or netmail and then displaying the header of a poll message or a normal message with votes:
      
      Program terminated with signal SIGSEGV, Segmentation fault.
      #0  0x00007f9f9569a317 in sbbs_t::show_msg (this=0x7f9f70c56880,
          smb=0x7f9f70c5e4e0, msg=0x7f9ebadf08b0, p_mode=4, post=0x7f9f18071a24)
          at getmsg.cpp:255
      255                                             ,cfg.sub[smb->subnum]->misc&SUB_                                                                              NAME ? useron.name : useron.alias, NET_NONE, NULL);
      [Current thread is 1 (Thread 0x7f9ebadf3700 (LWP 23279))]
      (gdb) print smb->subnum
      $1 = 4294967295
      (gdb) bt
      #0  0x00007f9f9569a317 in sbbs_t::show_msg (this=0x7f9f70c56880,
          smb=0x7f9f70c5e4e0, msg=0x7f9ebadf08b0, p_mode=4, post=0x7f9f18071a24)
          at getmsg.cpp:255
      #1  0x00007f9f957b2aee in sbbs_t::scanposts (this=0x7f9f70c56880, subnum=9,
          mode=2, find=0x7f9ebadf1270 "") at readmsgs.cpp:670
      #2  0x00007f9f957bb75a in sbbs_t::scanallsubs (this=0x7f9f70c56880, mode=2)
          at scansubs.cpp:219
      #3  0x00007f9f9568c948 in sbbs_t::exec_msg (this=0x7f9f70c56880,
          csi=0x7f9f70c64768) at execmsg.cpp:315
      #4  0x00007f9f95683129 in sbbs_t::exec_function (this=0x7f9f70c56880,
          csi=0x7f9f70c64768) at execfunc.cpp:422
      #5  0x00007f9f95679450 in sbbs_t::exec (this=0x7f9f70c56880,
          csi=0x7f9f70c64768) at exec.cpp:1199
      #6  0x00007f9f9577d742 in node_thread (arg=0x7f9f70c56880) at main.cpp:4364
      
      writemsg() was changing the global smb.subnum and when writing an email or netmail, that subnum value is -1 (since it's not a sub-board) and then later show_msg() is using the smb.subnum as a index into scfg.sub[] when determining if the current user already voted on the message being displayed and then: bang, crash, fall down, go boom.
      
      Simply saving and restoring the smb.subnum when executing an external editor is all that was needed here. And this is the first use of the C++ "auto" keyword in Synchronet!
      3da1fa6c
    • Rob Swindell's avatar
      Use mouse button release rather than press to activate a hotspot · 48b40607
      Rob Swindell authored
      As described in issue #412, when using extended mouse coordinate (SGR) mode, the mouse button release sequence would be received by the BBS after the hotspot-activated menu option was executed and then that button release sequence possibly passed through to the a child script or program that didn't know how to handle or ignore it.
      
      To resolve this, the BBS now ignores ("eats") the mouse button *press* sequence and only acts upon the mouse button *release* sequence. This is more aligned with how button-clicks work in mouse-control/GUI applications anyway.
      48b40607
  10. Jul 02, 2022
  11. Jun 28, 2022
  12. Jun 26, 2022
  13. Jun 25, 2022
  14. Jun 17, 2022
  15. Jun 15, 2022
  16. Jun 11, 2022
  17. Jun 06, 2022
    • Rob Swindell's avatar
      Perform a JS garbage collection for each new request in a reused session · ed729f9c
      Rob Swindell authored
      A reused HTTP session would never (apparently) perform garbage collection.
      The evidence of this was the collection of concurrent user.dat file opens
      that would never close until the HTTP sessions were closed. Hundreds or
      even thousands of open user.dat's have been seen. After this change,
      active web server (webv4 UI) users have not caused these spikes in open
      user.dat files, at least in my testing.
      
      If no garbage collection was being performed, then likely a lot of JS
      heap was being needlessly wasted, which could eventually result in a JS
      "out of memory" error. But that's just a theory.
      
      Investigation is needed into why the js_CommonOperationCallback()'s calls to
      JS_MaybeGC() were not sufficient to actually perform garbage collection
      in this case.
      ed729f9c
    • Rob Swindell's avatar
  18. Jun 05, 2022
Loading