blueprint-freespeech / ricochet-refresh

Anonymous peer-to-peer instant messaging
https://www.ricochetrefresh.net
Other
157 stars 27 forks source link

ContactRequestChannel.cpp:93:5: warning: potential null pointer dereference #181

Open milahu opened 5 months ago

milahu commented 5 months ago

https://github.com/blueprint-freespeech/ricochet-refresh/blob/cfa98b851fa7e5eaf7294c37aa3fd7bebcccfba8/src/libtego/source/protocol/ContactRequestChannel.cpp#L92-L93

[ 26%] Building CXX object libtego/CMakeFiles/tego.dir/source/protocol/ContactRequestChannel.cpp.o
In file included from /nix/store/n8pq15i0xd81g2i551ri15q441j19mz3-qtbase-5.15.12-dev/include/QtCore/qlist.h:48,
                 from /nix/store/n8pq15i0xd81g2i551ri15q441j19mz3-qtbase-5.15.12-dev/include/QtCore/qvariant.h:45,
                 from /nix/store/n8pq15i0xd81g2i551ri15q441j19mz3-qtbase-5.15.12-dev/include/QtCore/qabstractitemmodel.h:43,
                 from /nix/store/n8pq15i0xd81g2i551ri15q441j19mz3-qtbase-5.15.12-dev/include/QtCore/QAbstractListModel:1,
                 from /build/source/src/libtego/source/precomp.h:75,
                 from /build/source/src/build/libtego/CMakeFiles/tego.dir/cmake_pch.hxx:5,
                 from <command-line>:
In copy constructor 'QVector<T>::QVector(const QVector<T>&) [with T = unsigned int]',
    inlined from 'QVector<T>::QVector(const QVector<T>&) [with T = unsigned int]' at /nix/store/n8pq15i0xd81g2i551ri15q441j19mz3-qtbase-5.15.12-dev/include/QtCore/qvector.h:372:8,
    inlined from 'QtPrivate::QForeachContainer<T>::QForeachContainer(const T&) [with T = QVector<unsigned int>]' at /nix/store/n8pq15i0xd81g2i551ri15q441j19mz3-qtbase-5.15.12-dev/include/QtCore/qglobal.h:1074:37,
    inlined from 'QtPrivate::QForeachContainer<typename std::decay<_Tp>::type> QtPrivate::qMakeForeachContainer(T&&) [with T = QVector<unsigned int>&]' at /nix/store/n8pq15i0xd81g2i551ri15q441j19mz3-qtbase-5.15.12-dev/include/QtCore/qglobal.h:1102:78,
    inlined from 'bool isAcceptableNickname(const QString&)' at /build/source/src/libtego/source/protocol/ContactRequestChannel.cpp:93:5:
/nix/store/n8pq15i0xd81g2i551ri15q441j19mz3-qtbase-5.15.12-dev/include/QtCore/qvector.h:385:16: warning: potential null pointer dereference [8;;https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html#index-Wnull-dereference-Wnull-dereference8;;]
  385 |         if (d->alloc) {
      |             ~~~^~~~~

see also