Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Jul 2018 00:20:19 +0000 (UTC)
From:      "Pedro F. Giffuni" <pfg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r336322 - stable/11/lib/libiconv_modules/mapper_std
Message-ID:  <201807160020.w6G0KJMP097911@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: pfg
Date: Mon Jul 16 00:20:18 2018
New Revision: 336322
URL: https://svnweb.freebsd.org/changeset/base/336322

Log:
  MFC r336115;
  libiconv: correct undefined behavior.
  
  Detected on NetBSD:
  # nm /usr/lib/libc.so|grep sanit
      /public/src.git/lib/libc/citrus/modules/citrus_mapper_std.c:173:8:
  runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
  
  Obtained from:	NetBSD (CVS Rev. 1.11)

Modified:
  stable/11/lib/libiconv_modules/mapper_std/citrus_mapper_std.c
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/lib/libiconv_modules/mapper_std/citrus_mapper_std.c
==============================================================================
--- stable/11/lib/libiconv_modules/mapper_std/citrus_mapper_std.c	Sun Jul 15 22:18:31 2018	(r336321)
+++ stable/11/lib/libiconv_modules/mapper_std/citrus_mapper_std.c	Mon Jul 16 00:20:18 2018	(r336322)
@@ -1,5 +1,5 @@
 /* $FreeBSD$ */
-/*	$NetBSD: citrus_mapper_std.c,v 1.10 2011/11/19 18:48:39 tnozaki Exp $	*/
+/*	$NetBSD: citrus_mapper_std.c,v 1.11 2018/06/11 18:03:38 kamil Exp $ */
 
 /*-
  * Copyright (c)2003, 2006 Citrus Project,
@@ -159,7 +159,7 @@ rowcol_parse_variable_compat(struct _citrus_mapper_std
 	rc->rc_dst_invalid = be32toh(rcx->rcx_dst_invalid);
 	rc->rc_dst_unit_bits = be32toh(rcx->rcx_dst_unit_bits);
 	m = be32toh(rcx->rcx_src_col_bits);
-	n = 1 << (m - 1);
+	n = 1U << (m - 1);
 	n |= n - 1;
 	rc->rc_src_rowcol_bits = m;
 	rc->rc_src_rowcol_mask = n;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201807160020.w6G0KJMP097911>