aboutsummaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorRuss Allbery <eagle@eyrie.org>2018-06-03 16:58:04 -0700
committerRuss Allbery <eagle@eyrie.org>2018-06-03 16:58:04 -0700
commit52a00911071f6b1f61fc0a1f9c6f54bf38ab50a6 (patch)
treef60df4fa425feede71437ea91e6176369a5ae3b6 /util
parent6054a5b5806ed1e529b9fbed1c2284580f2a01be (diff)
parentedf31eba414d9a105791c076fb1444a78d210dff (diff)
Update upstream source from tag 'upstream/1.4'
Update to upstream version '1.4' with Debian dir 0b0d636e76769b309abb838da9361d95c611ebfe
Diffstat (limited to 'util')
-rw-r--r--util/macros.h18
-rw-r--r--util/messages-krb5.c6
-rw-r--r--util/messages-krb5.h10
-rw-r--r--util/messages.c15
-rw-r--r--util/messages.h14
-rw-r--r--util/xmalloc.c13
-rw-r--r--util/xmalloc.h15
7 files changed, 51 insertions, 40 deletions
diff --git a/util/macros.h b/util/macros.h
index 4a773a2..612a88c 100644
--- a/util/macros.h
+++ b/util/macros.h
@@ -2,17 +2,19 @@
* Some standard helpful macros.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2014 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2008-2011
+ * The Board of Trustees of the Leland Stanford Junior University
*
- * The authors hereby relinquish any claim to any copyright that they may have
- * in this work, whether granted under contract or by operation of law or
- * international treaty, and hereby commit to the public, at large, that they
- * shall not, at any time in the future, seek to enforce any copyright in this
- * work against any person or entity, or prevent any person or entity from
- * copying, publishing, distributing or creating derivative works of this
- * work.
+ * Copying and distribution of this file, with or without modification, are
+ * permitted in any medium without royalty provided the copyright notice and
+ * this notice are preserved. This file is offered as-is, without any
+ * warranty.
+ *
+ * SPDX-License-Identifier: FSFAP
*/
#ifndef UTIL_MACROS_H
diff --git a/util/messages-krb5.c b/util/messages-krb5.c
index 961ea1d..a33d77a 100644
--- a/util/messages-krb5.c
+++ b/util/messages-krb5.c
@@ -6,10 +6,10 @@
* formatted message.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2006, 2007, 2008, 2009, 2010, 2013
+ * Copyright 2006-2010, 2013
* The Board of Trustees of the Leland Stanford Junior University
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -29,6 +29,8 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
+ *
+ * SPDX-License-Identifier: MIT
*/
#include <config.h>
diff --git a/util/messages-krb5.h b/util/messages-krb5.h
index 3fc0862..da96e4c 100644
--- a/util/messages-krb5.h
+++ b/util/messages-krb5.h
@@ -2,10 +2,10 @@
* Prototypes for error handling for Kerberos.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2006, 2007, 2008, 2009, 2010, 2013
+ * Copyright 2006-2010, 2013
* The Board of Trustees of the Leland Stanford Junior University
*
* Permission is hereby granted, free of charge, to any person obtaining a
@@ -25,6 +25,8 @@
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
+ *
+ * SPDX-License-Identifier: MIT
*/
#ifndef UTIL_MESSAGES_KRB5_H
@@ -44,9 +46,9 @@ BEGIN_DECLS
* an error code to get the Kerberos error.
*/
void die_krb5(krb5_context, krb5_error_code, const char *, ...)
- __attribute__((__nonnull__, __noreturn__, __format__(printf, 3, 4)));
+ __attribute__((__nonnull__(3), __noreturn__, __format__(printf, 3, 4)));
void warn_krb5(krb5_context, krb5_error_code, const char *, ...)
- __attribute__((__nonnull__, __format__(printf, 3, 4)));
+ __attribute__((__nonnull__(3), __format__(printf, 3, 4)));
/* Undo default visibility change. */
#pragma GCC visibility pop
diff --git a/util/messages.c b/util/messages.c
index b5c2dba..941a88f 100644
--- a/util/messages.c
+++ b/util/messages.c
@@ -51,15 +51,14 @@
* va_list, and the applicable errno value (if any).
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
* Written by Russ Allbery <eagle@eyrie.org>
- * Copyright 2008, 2009, 2010, 2013
+ * Copyright 2015-2016 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2008-2010, 2013-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -75,6 +74,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#include <config.h>
@@ -238,7 +239,7 @@ message_log_syslog(int pri, size_t len, const char *fmt, va_list args, int err)
exit(message_fatal_cleanup ? (*message_fatal_cleanup)() : 1);
}
status = vsnprintf(buffer, len + 1, fmt, args);
- if (status < 0) {
+ if (status < 0 || (size_t) status >= len + 1) {
warn("failed to format output with vsnprintf in syslog handler");
free(buffer);
return;
diff --git a/util/messages.h b/util/messages.h
index cf91ba7..3620273 100644
--- a/util/messages.h
+++ b/util/messages.h
@@ -2,14 +2,14 @@
* Prototypes for message and error reporting (possibly fatal).
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
- * Copyright 2008, 2010, 2013, 2014
+ * Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2015 Russ Allbery <eagle@eyrie.org>
+ * Copyright 2008, 2010, 2013-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -25,6 +25,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#ifndef UTIL_MESSAGES_H
diff --git a/util/xmalloc.c b/util/xmalloc.c
index 7fb0405..f5cacc3 100644
--- a/util/xmalloc.c
+++ b/util/xmalloc.c
@@ -60,15 +60,14 @@
* line number to these functions.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
+ * Written by Russ Allbery <eagle@eyrie.org>
* Copyright 2015 Russ Allbery <eagle@eyrie.org>
- * Copyright 2012, 2013, 2014
+ * Copyright 2012-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -84,6 +83,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#include <config.h>
diff --git a/util/xmalloc.h b/util/xmalloc.h
index 6aa9b93..61f5ed1 100644
--- a/util/xmalloc.h
+++ b/util/xmalloc.h
@@ -2,14 +2,13 @@
* Prototypes for malloc routines with failure handling.
*
* The canonical version of this file is maintained in the rra-c-util package,
- * which can be found at <http://www.eyrie.org/~eagle/software/rra-c-util/>.
+ * which can be found at <https://www.eyrie.org/~eagle/software/rra-c-util/>.
*
- * Copyright 2010, 2012, 2013, 2014
+ * Written by Russ Allbery <eagle@eyrie.org>
+ * Copyright 2010, 2012-2014
* The Board of Trustees of the Leland Stanford Junior University
- * Copyright (c) 2004, 2005, 2006
- * by Internet Systems Consortium, Inc. ("ISC")
- * Copyright (c) 1991, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001,
- * 2002, 2003 by The Internet Software Consortium and Rich Salz
+ * Copyright 2004-2006 Internet Systems Consortium, Inc. ("ISC")
+ * Copyright 1991, 1994-2003 The Internet Software Consortium and Rich Salz
*
* This code is derived from software contributed to the Internet Software
* Consortium by Rich Salz.
@@ -25,6 +24,8 @@
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
+ *
+ * SPDX-License-Identifier: ISC
*/
#ifndef UTIL_XMALLOC_H
@@ -110,7 +111,7 @@ typedef void (*xmalloc_handler_type)(const char *, size_t, const char *, int);
/* The default error handler. */
void xmalloc_fail(const char *, size_t, const char *, int)
- __attribute__((__nonnull__));
+ __attribute__((__nonnull__, __noreturn__));
/*
* Assign to this variable to choose a handler other than the default, which