gethostbyname call with 0 length arg

Detlef Riekenberg wine.dev at web.de
Wed Feb 1 16:27:53 CST 2006


Am Sonntag, den 29.01.2006, 14:46 +0100 schrieb Phil Goss:

> There seems to be a check in the gethostbyname for a NULL arg name  ...  
> if(!name) ... But no check for  ... if(!strlen(name)) ....

Alexandre changed "strlen(xxx) > 0" in my first Patch to xxx[0]
So for your code above, simple change:

if(!name) {

to

if((!name) && (name[0])) {

The logic is the same: use the code-path, if name is NULL and use it
also, when the string is empty.

I send this type of patch yesterday and it's already in the tree.

The Commit-Message is here:
http://www.winehq.org/pipermail/wine-cvs/2006-February/020657.html

(i used (pName != NULL) to have a common style in this function)


> Does the above make sense, as I am not a programmer?
Yes, it does, and it's important when we have a Program that depend on
this behaviour.

> Not sure if this s bug in wine even though it implementation should be  
> matching Windows native.

That's also a reason, why we have the Testsuite.
A specific Test changes "should match" to 
"does not match (yet)" or "matches all the cases we tested".

The winedev-guide is nice to read. (see msg from James)


-- 
By By ...
      ... Detlef




More information about the wine-devel mailing list