Results 1 to 8 of 8

Thread: how to peek at serialized data from QDataStream

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    3
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: how to peek at serialized data from QDataStream

    Quote Originally Posted by jmenda View Post
    Checking for validity of correct type of data is my application's problem. And I understand from the documentation,that corrupted data should change QDataStream's status to QDataStream::ReadCorruptData.. so what other problem there could be?
    That you lose sync with the stream and the only thing you can do is disconnect the client. Besides, nobody checks the status of the stream anyway.

    I assume possibility of buffer overflow,etc. is taken care of by qt developers.
    There is no buffer overflow. Clients can just crash your machine by feeding it more data that the machine has RAM available while often you wait just for a few bytes of data. It is a rare case that your server works on generic data, usually you have some kind of protocol and you know how much data to expect. Relying on the client to provide a size followed by a blob is just asking for trouble.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. The following user says thank you to wysota for this useful post:

    jmenda (24th May 2011)

Similar Threads

  1. Serialized QByteArray length
    By giantdragon in forum Qt Programming
    Replies: 4
    Last Post: 21st May 2011, 22:10
  2. QDataStream loses data over QTcpSocket?
    By KShots in forum Qt Programming
    Replies: 11
    Last Post: 18th March 2011, 22:05
  3. Qt QDataStream supports data types
    By LoginFailed in forum Qt Programming
    Replies: 2
    Last Post: 30th December 2009, 08:41
  4. How to peek at the Event queue?
    By TheRonin in forum Qt Programming
    Replies: 3
    Last Post: 7th May 2009, 14:21
  5. avaiability of data from QDataStream
    By quickNitin in forum Newbie
    Replies: 1
    Last Post: 19th June 2006, 12:32

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.