Project

General

Profile

Bug #5588 » 0001-5588-invalid-use-of-NULL-in-itm_util.c.patch

updated with correct version - Richard PALO, 2015-02-04 09:21 AM

View differences:

usr/src/cmd/geniconvtbl/itm_util.c
23 23
 * Copyright (c) 1999 by Sun Microsystems, Inc.
24 24
 * All rights reserved.
25 25
 */
26
#pragma ident	"%Z%%M%	%I%	%E% SMI"
27

  
28 26
#include <assert.h>
29 27
#include <stdio.h>
30 28
#include <stdlib.h>
......
126 124
	du->obj = direc = malloc_vital(sizeof (itm_direc_t));
127 125

  
128 126
	if (NULL != cond) {
129
		direc->condition.itm_ptr = 0;
127
		direc->condition.itm_ptr = (uintptr_t)NULL;
130 128
		cond->referencer = &(direc->condition);
131 129
		du->ref[0] = cond;
132 130
	} else if (NULL != cond_name) {
......
182 180
#if !defined(_LP64)
183 181
		tbl->name.itm_pad = 0;
184 182
#endif
185
		tbl->name.itm_ptr = NULL;
183
		tbl->name.itm_ptr = (uintptr_t)NULL;
186 184
	}
187 185
	tbl->size = (sizeof (itm_tbl_hdr_t)) + (obj_array.num	*obj_size);
188 186
	tbl->number = obj_array.num;
......
534 532
	unsigned char		*byte_seq_max;
535 533
	unsigned char		*p;
536 534
	long			i;
537
	itmc_map_type_t		map_type = NULL;
535
	itmc_map_type_t		map_type = ITMC_MAP_UNKNOWN;
538 536
	itmc_map_name_type_t	*map_name_type;
539 537
	long			hash_factor;
540 538
	long			result_len_specfied = 0;
......
546 544
	if (attr != NULL) {
547 545
		map_type = check_map_type(attr);
548 546
	}
549
	if (NULL == map_type) {
547
	if (ITMC_MAP_UNKNOWN == map_type) {
550 548
		map_type = ITMC_MAP_AUTOMATIC;
551 549
	}
552 550
	hash_factor = ((NULL != attr) && (attr->hash_factor != 0)) ?
(2-2/2)