diff --git a/VERSION b/VERSION index af0b7dd..238d6e8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.6 +1.0.7 diff --git a/configure b/configure index a2c9396..d53e19a 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for openosc 1.0.5. +# Generated by GNU Autoconf 2.69 for openosc 1.0.7. # # Report bugs to . # @@ -590,8 +590,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='openosc' PACKAGE_TARNAME='openosc' -PACKAGE_VERSION='1.0.5' -PACKAGE_STRING='openosc 1.0.5' +PACKAGE_VERSION='1.0.7' +PACKAGE_STRING='openosc 1.0.7' PACKAGE_BUGREPORT='yonhan@cisco.com' PACKAGE_URL='' @@ -1329,7 +1329,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures openosc 1.0.5 to adapt to many kinds of systems. +\`configure' configures openosc 1.0.7 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1399,7 +1399,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of openosc 1.0.5:";; + short | recursive ) echo "Configuration of openosc 1.0.7:";; esac cat <<\_ACEOF @@ -1508,7 +1508,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -openosc configure 1.0.5 +openosc configure 1.0.7 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1998,7 +1998,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by openosc $as_me 1.0.5, which was +It was created by openosc $as_me 1.0.7, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2861,7 +2861,7 @@ fi # Define the identity of the package. PACKAGE='openosc' - VERSION='1.0.5' + VERSION='1.0.7' cat >>confdefs.h <<_ACEOF @@ -16738,7 +16738,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by openosc $as_me 1.0.5, which was +This file was extended by openosc $as_me 1.0.7, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -16804,7 +16804,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -openosc config.status 1.0.5 +openosc config.status 1.0.7 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/include/openosc_fortify.h b/include/openosc_fortify.h index 6d47fca..579b6ab 100644 --- a/include/openosc_fortify.h +++ b/include/openosc_fortify.h @@ -217,7 +217,7 @@ #define __dst_overflow_msg(func) func " caller with bigger length than size of destination buffer" #define __src_overread_msg(func) func " caller with bigger length than size of source buffer, will cause src overread" -#define __OPENOSC_CLANG_CC (defined __clang__ && __clang_major__ >= 5) +#define __OPENOSC_CLANG_CC 0 /* For clang compiler support */ #if defined __clang__ @@ -238,6 +238,8 @@ #define __pass_objsize1 #define __openosc_fortify_function __fortify_function #else +#undef __OPENOSC_CLANG_CC +#define __OPENOSC_CLANG_CC 1 #define __clang_error_if(c, m) __attribute__ ((__diagnose_if__ ((c), (m), "error"))) #define __clang_warning_if(c, m) __attribute__ ((__diagnose_if__ ((c), (m), "warning"))) #define __pass_objsize0 const __attribute__((pass_object_size(0))) diff --git a/src/openosc_map.c b/src/openosc_map.c index f2f19b0..03b1089 100644 --- a/src/openosc_map.c +++ b/src/openosc_map.c @@ -43,7 +43,7 @@ __openosc_memcpy_to_buf(size_t dest_len, size_t src_len, void *dst, const void * abort(); } if (openosc_truncate) { - if (dest_len <= 0) { + if ((dest_len == (size_t) -1) || (dest_len == 0)) { len = src_len; } else { len = MIN(src_len, dest_len); @@ -84,7 +84,7 @@ __openosc_memmove_to_buf(size_t dest_len, size_t src_len, void *dst, const void abort(); } if (openosc_truncate) { - if (dest_len <= 0) { + if ((dest_len == (size_t) -1) || (dest_len == 0)) { len = src_len; } else { len = MIN(src_len, dest_len); @@ -148,7 +148,7 @@ __openosc_bcopy_to_buf(size_t dest_len, size_t src_len, const void *src, void *d abort(); } if (openosc_truncate) { - if (dest_len <= 0) { + if ((dest_len == (size_t) -1) || (dest_len == 0)) { len = src_len; } else { len = MIN(src_len, dest_len); diff --git a/src/openosc_support.c b/src/openosc_support.c index 36844e8..d6b2f63 100644 --- a/src/openosc_support.c +++ b/src/openosc_support.c @@ -47,7 +47,6 @@ openosc_get_process_name(char *name, int name_len) { char path[OSC_PROC_PATH_MAX]; FILE* fd; - size_t size; if (!name) return FALSE; @@ -55,10 +54,9 @@ openosc_get_process_name(char *name, int name_len) snprintf(path, OSC_PROC_PATH_MAX, "/proc/%d/cmdline", getpid()); fd = fopen(path, "r"); if (fd != NULL) { - size = fread((void *)name, sizeof(char), name_len, fd); + size_t size = fread((void *)name, sizeof(char), name_len, fd); if (size > 0) { - if('\n' == name[size-1]) - name[size-1]='\0'; + name[size-1]='\0'; } fclose(fd); return TRUE; @@ -129,14 +127,14 @@ openosc_bt2str_offset (void *bt[], int frames, char *bt_str, * If the symbol is in us, just print the offset */ s += snprintf(&bt_str[s], (bt_str_max - s), "+%p ", - (void *)(bt[f] - info.dli_fbase)); + (void *)((char *)bt[f] - (char *)info.dli_fbase)); } else { bname = basename(info.dli_fname); /* * Otherwise print library+offset */ s += snprintf(&bt_str[s], (bt_str_max - s), "%s+%p ", - bname, (void *)(bt[f] - info.dli_fbase)); + bname, (void *)((char *)bt[f] - (char *)info.dli_fbase)); } } }