Author: greatlrd Date: Sun Jun 4 00:29:26 2006 New Revision: 22200
URL: http://svn.reactos.ru/svn/reactos?rev=22200&view=rev Log: do not cuase crash in dhcp when no networkcard is found
Modified: trunk/reactos/base/services/dhcp/util.c
Modified: trunk/reactos/base/services/dhcp/util.c URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/base/services/dhcp/util.c?re... ============================================================================== --- trunk/reactos/base/services/dhcp/util.c (original) +++ trunk/reactos/base/services/dhcp/util.c Sun Jun 4 00:29:26 2006 @@ -98,10 +98,19 @@
int read_client_conf(void) { /* What a strage dance */ - struct client_config *config = ifi->client->config; + struct client_config *config; char ComputerName [MAX_COMPUTERNAME_LENGTH + 1]; DWORD ComputerNameSize = sizeof ComputerName / sizeof ComputerName[0];
+ if ((ifi!= NULL) && (ifi->client->config != NULL)) + config = ifi->client->config; + else + { + warn("util.c read_client_conf poorly implemented!"); + return 0; + } + + GetComputerName(ComputerName, & ComputerNameSize); /* This never gets freed since it's only called once */ LPSTR lpCompName =