#1709 closed defect (fixed)

gethostent_r incorrectly tests pointer validity

Reported by: Tim Cussins Owned by: Joel Sherrill
Priority: normal Milestone: 4.11
Component: network/legacy Version: 4.9
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description (last modified by Sebastian Huber)

struct hostent* gethostent_r(char* buf, int len)

is defined in cpukit/libnetworking/libc/gethostbyht.c

and tests variable 'hostf' for validity (line 226) using

if (hostf<0) return 0;

hostf, when invalid, can also be NULL, so I recommend changing this to

if (hostf<=0) return 0;

see attached :)

Attachments (1)

rtems-gethostbyht-hostf.diff (337 bytes) - added by Tim Cussins on Oct 6, 2010 at 1:52:55 PM.
Recommended bugfix for hostf validity test

Download all attachments as: .zip

Change History (6)

Changed on Oct 6, 2010 at 1:52:55 PM by Tim Cussins

Recommended bugfix for hostf validity test

comment:1 Changed on Oct 6, 2010 at 2:29:30 PM by Tim Cussins

note - the patch is reversed, sorry!

comment:2 Changed on Nov 22, 2014 at 2:26:29 PM by Gedare Bloom

Description: modified (diff)
Milestone: 4.114.10.3
Owner: changed from Eric Norum to Joel Sherrill
Status: newassigned
Version: HEAD4.10

comment:3 Changed on Nov 22, 2014 at 2:27:27 PM by Gedare Bloom

Milestone: 4.10.34.9.5
Version: 4.104.9

comment:4 Changed on Dec 16, 2015 at 6:41:48 AM by Sebastian Huber

Description: modified (diff)
Milestone: 4.9.54.11

Duplicate of #1983.

comment:5 Changed on Dec 16, 2015 at 6:42:08 AM by Sebastian Huber

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.