Menu

#72 reading zero bytes in readNlSock()

v1.0.1
accepted
None
1
2020-10-09
2020-08-13
No

In the file bip-init.c, function

static int readNlSock
int sockFd, char *bufPtr, size_t buf_size, int seqNum, int pId)

when reading

    do {
    /* Receive response from the kernel */
    if ((readLen = recv(sockFd, bufPtr, buf_size - msgLen, 0)) < 0) {
        perror("SOCK READ: ");
        return -1;
    }

  // Need to check if zero bytes was read and break - this is my fix
    if(!readLen) {
        break;
    }

...

Thank you!
Mikhail

Related

Bugs: #72

Discussion

  • Steve Karg

    Steve Karg - 2020-10-09
    • status: open --> accepted
    • assigned_to: Duane L. King, esq. --> Steve Karg
     
    • Duane L. King, esq.

      Hi Steve,

      I feel flattered. I assume this is a mistake.

      Anyway thanks for thinking of me!
      Duane

      On Thu, Oct 8, 2020 at 11:05 PM Steve Karg skarg@users.sourceforge.net
      wrote:

      • status: open --> accepted
      • assigned_to: Duane L. King, esq. --> Steve Karg

      Status: accepted
      Group: v1.0.1
      Created: Thu Aug 13, 2020 12:24 AM UTC by Mikhail Tchernychev
      Last Updated: Thu Aug 13, 2020 12:24 AM UTC
      Owner: Steve Karg

      In the file bip-init.c, function

      static int readNlSock
      int sockFd, char *bufPtr, size_t buf_size, int seqNum, int pId)

      when reading

      do {
      /* Receive response from the kernel */
      if ((readLen = recv(sockFd, bufPtr, buf_size - msgLen, 0)) < 0) {
          perror("SOCK READ: ");
          return -1;
      }
      

      // Need to check if zero bytes was read and break - this is my fix
      if(!readLen) {
      break;
      }

      ...

      Thank you!
      Mikhail


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/bacnet/bugs/72/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

      --
      Duane L. King - I can Debug Anything
      Embedded Software Engineer

       

      Related

      Bugs: #72

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB