Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/openpam/dist/lib - add casts for sign-changing ...
details: https://anonhg.NetBSD.org/src/rev/2ca987d00fda
branches: trunk
changeset: 325574:2ca987d00fda
user: christos <christos%NetBSD.org@localhost>
date: Sun Dec 29 22:55:32 2013 +0000
description:
- add casts for sign-changing conversions
- fix types
diffstat:
external/bsd/openpam/dist/lib/openpam_set_option.c | 5 +++--
external/bsd/openpam/dist/lib/openpam_straddch.c | 4 ++--
external/bsd/openpam/dist/lib/openpam_subst.c | 4 ++--
external/bsd/openpam/dist/lib/openpam_ttyconv.c | 4 ++--
external/bsd/openpam/dist/lib/pam_getenvlist.c | 4 ++--
external/bsd/openpam/dist/lib/pam_putenv.c | 4 ++--
external/bsd/openpam/dist/lib/pam_start.c | 4 ++--
7 files changed, 15 insertions(+), 14 deletions(-)
diffs (127 lines):
diff -r 0feadfe31806 -r 2ca987d00fda external/bsd/openpam/dist/lib/openpam_set_option.c
--- a/external/bsd/openpam/dist/lib/openpam_set_option.c Sun Dec 29 22:54:58 2013 +0000
+++ b/external/bsd/openpam/dist/lib/openpam_set_option.c Sun Dec 29 22:55:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: openpam_set_option.c,v 1.4 2013/12/27 20:10:21 christos Exp $ */
+/* $NetBSD: openpam_set_option.c,v 1.5 2013/12/29 22:55:32 christos Exp $ */
/*-
* Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -93,7 +93,8 @@
RETURNC(PAM_BUF_ERR);
if (i == cur->optc) {
/* add */
- optv = realloc(cur->optv, sizeof(char *) * (cur->optc + 2));
+ optv = realloc(cur->optv,
+ sizeof(*optv) * ((size_t)cur->optc + 2));
if (optv == NULL) {
FREE(opt);
RETURNC(PAM_BUF_ERR);
diff -r 0feadfe31806 -r 2ca987d00fda external/bsd/openpam/dist/lib/openpam_straddch.c
--- a/external/bsd/openpam/dist/lib/openpam_straddch.c Sun Dec 29 22:54:58 2013 +0000
+++ b/external/bsd/openpam/dist/lib/openpam_straddch.c Sun Dec 29 22:55:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: openpam_straddch.c,v 1.1.1.2 2013/12/27 19:27:42 christos Exp $ */
+/* $NetBSD: openpam_straddch.c,v 1.2 2013/12/29 22:55:32 christos Exp $ */
/*-
* Copyright (c) 2012 Dag-Erling Smørgrav
@@ -79,7 +79,7 @@
*str = tmpstr;
}
if (ch != 0) {
- (*str)[*len] = ch;
+ (*str)[*len] = (char)ch;
++*len;
}
(*str)[*len] = '\0';
diff -r 0feadfe31806 -r 2ca987d00fda external/bsd/openpam/dist/lib/openpam_subst.c
--- a/external/bsd/openpam/dist/lib/openpam_subst.c Sun Dec 29 22:54:58 2013 +0000
+++ b/external/bsd/openpam/dist/lib/openpam_subst.c Sun Dec 29 22:55:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: openpam_subst.c,v 1.4 2013/12/27 20:10:21 christos Exp $ */
+/* $NetBSD: openpam_subst.c,v 1.5 2013/12/29 22:55:32 christos Exp $ */
/*-
* Copyright (c) 2011 Dag-Erling Smørgrav
@@ -40,7 +40,7 @@
#include "openpam_impl.h"
#define subst_char(ch) do { \
- int ch_ = (ch); \
+ char ch_ = (ch); \
if (buf && len < *bufsize) \
*buf++ = ch_; \
++len; \
diff -r 0feadfe31806 -r 2ca987d00fda external/bsd/openpam/dist/lib/openpam_ttyconv.c
--- a/external/bsd/openpam/dist/lib/openpam_ttyconv.c Sun Dec 29 22:54:58 2013 +0000
+++ b/external/bsd/openpam/dist/lib/openpam_ttyconv.c Sun Dec 29 22:55:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: openpam_ttyconv.c,v 1.8 2013/12/27 20:10:21 christos Exp $ */
+/* $NetBSD: openpam_ttyconv.c,v 1.9 2013/12/29 22:55:32 christos Exp $ */
/*-
* Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -409,7 +409,7 @@
}
if (infp != stdin)
(void)fclose(infp);
- memset(aresp, 0, n * sizeof *aresp);
+ memset(aresp, 0, (size_t)n * sizeof *aresp);
FREE(aresp);
*resp = NULL;
memset(respbuf, 0, sizeof respbuf);
diff -r 0feadfe31806 -r 2ca987d00fda external/bsd/openpam/dist/lib/pam_getenvlist.c
--- a/external/bsd/openpam/dist/lib/pam_getenvlist.c Sun Dec 29 22:54:58 2013 +0000
+++ b/external/bsd/openpam/dist/lib/pam_getenvlist.c Sun Dec 29 22:55:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pam_getenvlist.c,v 1.4 2013/12/27 20:10:21 christos Exp $ */
+/* $NetBSD: pam_getenvlist.c,v 1.5 2013/12/29 22:55:32 christos Exp $ */
/*-
* Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -64,7 +64,7 @@
ENTER();
if (pamh == NULL)
RETURNP(NULL);
- envlist = malloc(sizeof(char *) * (pamh->env_count + 1));
+ envlist = malloc(sizeof(*envlist) * ((size_t)pamh->env_count + 1));
if (envlist == NULL) {
openpam_log(PAM_LOG_ERROR, "%s",
pam_strerror(pamh, PAM_BUF_ERR));
diff -r 0feadfe31806 -r 2ca987d00fda external/bsd/openpam/dist/lib/pam_putenv.c
--- a/external/bsd/openpam/dist/lib/pam_putenv.c Sun Dec 29 22:54:58 2013 +0000
+++ b/external/bsd/openpam/dist/lib/pam_putenv.c Sun Dec 29 22:55:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pam_putenv.c,v 1.4 2013/12/27 20:10:21 christos Exp $ */
+/* $NetBSD: pam_putenv.c,v 1.5 2013/12/29 22:55:32 christos Exp $ */
/*-
* Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -83,7 +83,7 @@
/* grow the environment list if necessary */
if (pamh->env_count == pamh->env_size) {
env = realloc(pamh->env,
- sizeof(char *) * (pamh->env_size * 2 + 1));
+ sizeof(*env) * ((size_t)pamh->env_size * 2 + 1));
if (env == NULL)
RETURNC(PAM_BUF_ERR);
pamh->env = env;
diff -r 0feadfe31806 -r 2ca987d00fda external/bsd/openpam/dist/lib/pam_start.c
--- a/external/bsd/openpam/dist/lib/pam_start.c Sun Dec 29 22:54:58 2013 +0000
+++ b/external/bsd/openpam/dist/lib/pam_start.c Sun Dec 29 22:55:32 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: pam_start.c,v 1.5 2013/12/27 20:10:21 christos Exp $ */
+/* $NetBSD: pam_start.c,v 1.6 2013/12/29 22:55:32 christos Exp $ */
/*-
* Copyright (c) 2002-2003 Networks Associates Technology, Inc.
@@ -75,7 +75,7 @@
#else
h = -1;
#endif
- hostname_size = (h < 10 ? 1024 : h) + 1;
+ hostname_size = (size_t)(h < 10 ? 1024 : h) + 1;
ENTER();
if ((ph = calloc((size_t)1, sizeof *ph)) == NULL)
Home |
Main Index |
Thread Index |
Old Index