News for hackers. Stuff that matters.
Re:Another flaw in Signal desktop app leaks chats in plaintext by jhasse on Friday May 18, 2018 @08:41AM (#17100939)
Care to give an example?
Re:Another flaw in Signal desktop app leaks chats in plaintext by moefh on Friday May 18, 2018 @01:22PM (#17103198)
Assuming OP was talking about overloading the '=' operator:

  struct A {
    int *p = nullptr;
  
    A& operator=(int i) {
      *p = i;
      return *this;
    }
  };

  int main(void)
  {
    A a;
    a = 1;  /* boom! */
    return 0;
  }
Re:Another flaw in Signal desktop app leaks chats in plaintext by camgunz on Friday May 18, 2018 @01:21PM (#17103191)
strcat (or, honestly, anything in string.h). strcat assumes its first argument has enough allocated space for the contents of the 2nd argument, and that the 2nd argument is NULL terminated. If either of those assumptions is wrong, strcat will overwrite memory, corrupting either your heap or your stack, both of which can lead to arbitrary code execution. It's laughably easy to do, so easy that even typing the letters `strcat` into your program is forbidden in basically every C/C++ shop.
Re:Another flaw in Signal desktop app leaks chats in plaintext by jhasse on Saturday May 19, 2018 @01:37PM (#17108841)
strcat is C and not C++ though.
Re:Another flaw in Signal desktop app leaks chats in plaintext by camgunz on Sunday May 20, 2018 @11:13AM (#17113062)
Nah it's both. C++ was deliberately designed to be a superset of C. It's diverged a little bit, but it's mostly still the case. Or, call it `std::strcat` if you like.