Skip to content
Snippets Groups Projects
  1. Jan 04, 2025
  2. Jan 03, 2025
    • Deucе's avatar
      Socket.recv() can return null and undefined · d7de4b88
      Deucе authored
      d7de4b88
    • Deucе's avatar
      Don't return 0 when unable to parse integers. · 8a9d76c0
      Deucе authored
      0 is a valid value, results are undefined.
      
      Validate the size of the message at each step and throw an error if
      something goes wrong.
      
      Should fix the issue where an IRC spammers DNS was detected as local,
      so the anti-spammer bot banned my server address intead of the
      spammers address.
      8a9d76c0
    • Deucе's avatar
    • Deucе's avatar
      Try to tell Coverity that getch() isn't constant. · ba945f3c
      Deucе authored
      I'm not sure if I can do this with events, or just issues, and I
      don't want to directly annotate this issue because that could lead
      to missing an issue after a future code change.
      
      The return value of getch() will never be const though.
      ba945f3c
    • Deucе's avatar
      Annotate intentional "missing locks" · e3a446a9
      Deucе authored
      e3a446a9
    • Deucе's avatar
      Annotate missing commas · 1af568c2
      Deucе authored
      1af568c2
    • Deucе's avatar
      Annotate risky call to random() · f5a033dd
      Deucе authored
      f5a033dd
    • Deucе's avatar
      2c166fd0
    • Deucе's avatar
      Return value of write() is tainted · 2b4691d3
      Deucе authored
      Since Coverity treates the return value of write() as tainted
      (valid for negative values, not so valid for positive ones), do an
      upper bound check on the result as well as lower bound to clear
      the tainted flag.
      2b4691d3
    • Deucе's avatar
      Ok, so the real issue Coverity has is the tainting of nX. · d2cd0a65
      Deucе authored
      Have zmodem_recv_nibble() explicitly range-check all values, and
      handle negative values.  If this remains an issue, it can be
      untainted with range checks on each nibble, but let's not go there
      to start with.
      d2cd0a65
    • Deucе's avatar
      More type fixes. · 76a1eb0f
      Deucе authored
      76a1eb0f
    • Deucе's avatar
      Remove stutter. · 403fce39
      Deucе authored
      403fce39
    • Deucе's avatar
      "Range check" RIP ICN width/height to untaint them. · 6f8678eb
      Deucе authored
      This is purely to shut up Coverity since there's no way the value
      could be outside the range.
      6f8678eb
    • Deucе's avatar
      Move ssh_complete out of ssh_mutex · e15ba307
      Deucе authored
      Coverity seems to hate it mostly in the mutex, so change it to
      mostly outside of the mutex and see if that's fine.
      
      It doesn't really matter where it's changed as it's an atomic bool.
      e15ba307
    • Deucе's avatar
      Add missing continue · caa48db0
      Deucе authored
      We don't want ch == -2 derping through the rest of the loop.
      Luckily, ch is never currently == -2 as far as I know.
      caa48db0
    • Deucе's avatar
      0158699a
    • Deucе's avatar
      Add some paranoia around size of macros. · 110f23bf
      Deucе authored
      Initially set 1MB as the max macro size.  I can't imagine wanting
      one bigger than this, but I can bump it up if needed.
      
      This likely fixes a vulerability where the BBS could at least crash
      SyncTERM, and at most take control of the users system.  This
      likely isn't the only place that needs bounds checks like this.
      110f23bf
    • Deucе's avatar
      Make the types correct and eliminate infinite loop. · a51bb085
      Deucе authored
      If a write() to the sound device fails (for example USB device goes
      away), this would loop forever (in it's own thread and whatnot,
      so you only notice because sounds stops and a core gets used up).
      a51bb085
    • Deucе's avatar
      *Sigh* Borland. · 8c4af199
      Deucе authored
      8c4af199
    • Deucе's avatar
      Bring some sanity to sendfilesocket() · 2f78d960
      Deucе authored
      Not that there's any need to, it appears that it was written for
      the web server, then discarded for that purpose and now is only
      called from the JS Socket.sendfile() method, which always passes
      NULL and 0 for the last two parameters, and has a copy/pasted
      implementation for TLS sockets.  The only consumer of that in
      the tree appears to be gopher_service.js.
      
      It was apparently to use as a wrapper for the high-performance
      FreeBSD sendfile(), but that code behaved differently than all
      the other platforms, and was disabled (behind USE_SENDFILE, which
      isn't defined anywhere).
      
      This should really just be folded into either js_socket_sendfilesocket()
      or js_sendfile() with the extra knobs broken off and all the TODO
      comments I'm adding here addressed.
      
      Though, since Socket.sendfile() returns a bool where true indicates
      that either the size of the file at the start of the function
      was sent, or an EOF was reached, and false indicates that
      "something else happened", some of the TODO comments don't really
      need to be addressed.
      
      Basically, this is a crap function and it's only used by an even
      more crap JS wrapper, it should be tucked into a backward
      compatibility function, removed from the JSDocs, and forgotten
      about.
      
      If Coverity keeps complaining about this, I'll wait until after
      the next release and drag this out back and shoot it.  Otherwise,
      I'll just forget it ever existed.
      2f78d960
    • Deucе's avatar
      Fix types here too. · ba5187ac
      Deucе authored
      ba5187ac
    • Deucе's avatar
      Fix types. · a6a9d6a3
      Deucе authored
      a6a9d6a3
Loading