Hi all, during packaging the DHCP suite for Openwall GNU/*/Linux I fixed some error warnings about uninitialized variables. I compiled the package with -O2 -fomit-frame-pointer -Wall -Wno-unused. The patch is attached. Greets -- Matthias Schmidt -- Attached file included as plaintext by Ecartis -- diff -urpN dhcp-3.0pl2.orig/client/clparse.c dhcp-3.0pl2/client/clparse.c --- dhcp-3.0pl2.orig/client/clparse.c Fri Jun 1 19:26:44 2001 +++ dhcp-3.0pl2/client/clparse.c Thu Sep 11 11:01:36 2003 @@ -602,7 +602,7 @@ void parse_option_list (cfile, list) int ix, i; int token; const char *val; - pair p = (pair)0, q, r; + pair p = (pair)0, q = (pair)0, r; ix = 0; do { @@ -732,7 +732,7 @@ int interface_or_dummy (struct interface { struct interface_info *i; struct interface_info *ip = (struct interface_info *)0; - isc_result_t status; + isc_result_t status = (isc_result_t)0; /* Find the interface (if any) that matches the name. */ for (i = interfaces; i; i = i -> next) { diff -urpN dhcp-3.0pl2.orig/common/conflex.c dhcp-3.0pl2/common/conflex.c --- dhcp-3.0pl2.orig/common/conflex.c Mon Jun 4 23:18:39 2001 +++ dhcp-3.0pl2/common/conflex.c Tue Sep 9 11:57:51 2003 @@ -312,8 +312,8 @@ static enum dhcp_token read_string (cfil int i; int bs = 0; int c; - int value; - int hex; + int value = 0; + int hex = 0; for (i = 0; i < sizeof cfile -> tokbuf; i++) { again: diff -urpN dhcp-3.0pl2.orig/common/execute.c dhcp-3.0pl2/common/execute.c --- dhcp-3.0pl2.orig/common/execute.c Wed Aug 8 16:48:19 2001 +++ dhcp-3.0pl2/common/execute.c Tue Sep 9 12:01:07 2003 @@ -660,7 +660,7 @@ void write_statements (file, statements, int result; int status; const char *s, *t, *dot; - int col; + int col = 0; if (!statements) return; diff -urpN dhcp-3.0pl2.orig/common/packet.c dhcp-3.0pl2/common/packet.c --- dhcp-3.0pl2.orig/common/packet.c Thu May 31 21:28:51 2001 +++ dhcp-3.0pl2/common/packet.c Thu Sep 11 11:46:31 2003 @@ -237,7 +237,7 @@ ssize_t decode_udp_ip_header (interface, static int udp_packets_bad_checksum; static int udp_packets_length_checked; static int udp_packets_length_overflow; - unsigned len; + unsigned len = 0; unsigned ulen; int ignore = 0; diff -urpN dhcp-3.0pl2.orig/common/tree.c dhcp-3.0pl2/common/tree.c --- dhcp-3.0pl2.orig/common/tree.c Thu Oct 4 22:38:22 2001 +++ dhcp-3.0pl2/common/tree.c Thu Sep 11 11:26:03 2003 @@ -655,7 +655,7 @@ int evaluate_dns_expression (result, pac { ns_updrec *foo; unsigned long ttl = 0; - char *tname; + char *tname = NULL; struct data_string name, data; int r0, r1, r2, r3; @@ -1281,7 +1281,7 @@ int evaluate_data_expression (result, pa struct data_string data, other; unsigned long offset, len, i; int s0, s1, s2, s3; - int status; + int status = 0; struct binding *binding; char *s; struct binding_value *bv; diff -urpN dhcp-3.0pl2.orig/omapip/alloc.c dhcp-3.0pl2/omapip/alloc.c --- dhcp-3.0pl2.orig/omapip/alloc.c Fri Jun 22 02:22:57 2001 +++ dhcp-3.0pl2/omapip/alloc.c Tue Sep 9 12:04:02 2003 @@ -512,7 +512,7 @@ isc_result_t omapi_object_allocate (omap size_t size, const char *file, int line) { - size_t tsize; + size_t tsize = 0; omapi_object_t *foo; isc_result_t status; @@ -789,11 +789,11 @@ isc_result_t omapi_typed_data_new (const va_list l; omapi_typed_data_t *new; unsigned len; - unsigned val; - int intval; - char *s; + unsigned val = 0; + int intval = 0; + char *s = NULL; isc_result_t status; - omapi_object_t *obj; + omapi_object_t *obj = NULL; va_start (l, type); diff -urpN dhcp-3.0pl2.orig/omapip/connection.c dhcp-3.0pl2/omapip/connection.c --- dhcp-3.0pl2.orig/omapip/connection.c Wed Jun 20 05:53:33 2001 +++ dhcp-3.0pl2/omapip/connection.c Tue Sep 9 14:05:12 2003 @@ -717,8 +717,8 @@ static isc_result_t make_dst_key (DST_KE omapi_value_t *name = (omapi_value_t *)0; omapi_value_t *algorithm = (omapi_value_t *)0; omapi_value_t *key = (omapi_value_t *)0; - int algorithm_id; - char *name_str; + int algorithm_id = 0; + char *name_str = NULL; isc_result_t status = ISC_R_SUCCESS; if (status == ISC_R_SUCCESS) diff -urpN dhcp-3.0pl2.orig/omapip/convert.c dhcp-3.0pl2/omapip/convert.c --- dhcp-3.0pl2.orig/omapip/convert.c Wed Aug 2 00:34:36 2000 +++ dhcp-3.0pl2/omapip/convert.c Thu Sep 11 15:16:02 2003 @@ -135,7 +135,7 @@ int converted_length (buf, base, width) unsigned int base; unsigned int width; { - u_int32_t number; + u_int32_t number = 0; u_int32_t column; int power = 1; u_int32_t newcolumn = base; @@ -169,7 +169,7 @@ int binary_to_ascii (outbuf, inbuf, base unsigned int base; unsigned int width; { - u_int32_t number; + u_int32_t number = 0; static char h2a [] = "0123456789abcdef"; int power = converted_length (inbuf, base, width); int i, j; diff -urpN dhcp-3.0pl2.orig/omapip/dispatch.c dhcp-3.0pl2/omapip/dispatch.c --- dhcp-3.0pl2.orig/omapip/dispatch.c Thu May 31 21:45:55 2001 +++ dhcp-3.0pl2/omapip/dispatch.c Tue Sep 9 15:31:14 2003 @@ -505,7 +505,7 @@ isc_result_t omapi_io_get_value (omapi_o isc_result_t omapi_io_destroy (omapi_object_t *h, const char *file, int line) { - omapi_io_object_t *obj, *p, *last; + omapi_io_object_t *obj, *p, *last = NULL; if (h -> type != omapi_type_io_object) return ISC_R_INVALIDARG; diff -urpN dhcp-3.0pl2.orig/omapip/message.c dhcp-3.0pl2/omapip/message.c --- dhcp-3.0pl2.orig/omapip/message.c Wed Jun 20 05:55:37 2001 +++ dhcp-3.0pl2/omapip/message.c Thu Sep 11 11:09:23 2003 @@ -404,7 +404,7 @@ omapi_message_process_internal (omapi_ob omapi_value_t *tv = (omapi_value_t *)0; unsigned long create, update, exclusive; unsigned long wsi; - isc_result_t status, waitstatus; + isc_result_t status = (isc_result_t)0, waitstatus; omapi_object_type_t *type; if (mo -> type != omapi_type_message) diff -urpN dhcp-3.0pl2.orig/server/confpars.c dhcp-3.0pl2/server/confpars.c --- dhcp-3.0pl2.orig/server/confpars.c Fri Oct 5 00:08:35 2001 +++ dhcp-3.0pl2/server/confpars.c Thu Sep 11 11:08:49 2003 @@ -77,7 +77,7 @@ isc_result_t readconf () isc_result_t read_conf_file (const char *filename, struct group *group, int group_type, int leasep) { - int file; + int file = 0; struct parse *cfile; isc_result_t status; #if defined (TRACING) @@ -1709,7 +1709,7 @@ int parse_class_declaration (cp, cfile, struct executable_statement *stmt = (struct executable_statement *)0; struct expression *expr; int new = 1; - isc_result_t status; + isc_result_t status = (isc_result_t)0; token = next_token (&val, (unsigned *)0, cfile); if (token != STRING) { @@ -2406,7 +2406,7 @@ int parse_lease_declaration (struct leas unsigned char addr [4]; unsigned len = sizeof addr; int seenmask = 0; - int seenbit; + int seenbit = 0; char tbuf [32]; struct lease *lease; struct executable_statement *on; @@ -2415,12 +2415,12 @@ int parse_lease_declaration (struct leas int lose; TIME t; char *s; - int noequal, newbinding; + int noequal, newbinding = 0; struct binding *binding; isc_result_t status; struct option_cache *oc; pair *p; - binding_state_t new_state; + binding_state_t new_state = (binding_state_t)0; unsigned buflen = 0; struct class *class; diff -urpN dhcp-3.0pl2.orig/server/failover.c dhcp-3.0pl2/server/failover.c --- dhcp-3.0pl2.orig/server/failover.c Thu Aug 23 18:25:51 2001 +++ dhcp-3.0pl2/server/failover.c Thu Sep 11 11:43:47 2003 @@ -3395,12 +3395,12 @@ failover_option_t *dhcp_failover_make_op va_list va; struct failover_option_info *info; int i; - unsigned size, count; + unsigned size = 0, count; unsigned val; u_int8_t *iaddr; - unsigned ilen; + unsigned ilen = 0; u_int8_t *bval; - char *txt; + char *txt = NULL; #if defined (DEBUG_FAILOVER_MESSAGES) char tbuf [256]; #endif @@ -4887,7 +4887,7 @@ normal_binding_state_transition_check (s binding_state_t binding_state, u_int32_t tsfp) { - binding_state_t new_state; + binding_state_t new_state = binding_state; /* If there is no transition, it's no problem. */ if (binding_state == lease -> binding_state) @@ -5054,7 +5054,7 @@ conflict_binding_state_transition_check binding_state_t binding_state, u_int32_t tsfp) { - binding_state_t new_state; + binding_state_t new_state = binding_state; /* If there is no transition, it's no problem. */ if (binding_state == lease -> binding_state) diff -urpN dhcp-3.0pl2.orig/server/omapi.c dhcp-3.0pl2/server/omapi.c --- dhcp-3.0pl2.orig/server/omapi.c Fri Jun 22 04:28:51 2001 +++ dhcp-3.0pl2/server/omapi.c Thu Sep 11 11:02:29 2003 @@ -2048,7 +2048,7 @@ isc_result_t binding_scope_get_value (om { struct binding *bp; omapi_typed_data_t *td; - isc_result_t status; + isc_result_t status = (isc_result_t)0; char *nname; nname = dmalloc (name -> len + 1, MDL); if (!nname)