RE: [patch 4/7] [PATCH] ctcm: make ctcmpc debugging compilable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>  static const struct xid2 init_xid = {
> @@ -132,7 +132,7 @@ void ctcmpc_dumpit(char *buf, int len)
>  	__u32	ct, sw, rm, dup;
>  	char	*ptr, *rptr;
>  	char	tbuf[82], tdup[82];
> -	#if (UTS_MACHINE == s390x)
> +	#ifdef CONFIG_64BIT
>  	char	addr[22];
>  	#else
>  	char	addr[12];
> @@ -149,8 +149,8 @@ void ctcmpc_dumpit(char *buf, int len)
>  
>  	for (ct = 0; ct < len; ct++, ptr++, rptr++) {
>  		if (sw == 0) {
> -			#if (UTS_MACHINE == s390x)
> -			sprintf(addr, "%16.16lx", (__u64)rptr);
> +			#ifdef CONFIG_64BIT
> +			sprintf(addr, "%16.16llx", (__u64)rptr);
>  			#else
>  			sprintf(addr, "%8.8X", (__u32)rptr);
>  			#endif

What is wrong with:
	char addr[24];
	snprintf(addr, sizeof addr, "%p", rptr);

There seemed to be other 'dangerous' unbounded string
operations in that code as well.

	David


--
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux