1
0
mirror of https://gitlab.com/dm38/padavan-ng.git synced 2024-02-13 08:34:03 +08:00

uclibc: update to 1.0.37

This commit is contained in:
Alexey
2021-03-01 13:42:20 +03:00
parent d67d04a5bf
commit bc802c3c0e
5 changed files with 30 additions and 9 deletions

View File

@ -128,7 +128,7 @@ export RUNTIME_PREFIX DEVEL_PREFIX KERNEL_HEADERS MULTILIB_DIR
# Now config hard core
MAJOR_VERSION := 1
MINOR_VERSION := 0
SUBLEVEL := 36
SUBLEVEL := 37
EXTRAVERSION :=
VERSION := $(MAJOR_VERSION).$(MINOR_VERSION).$(SUBLEVEL)
ABI_VERSION := $(MAJOR_VERSION)

View File

@ -505,7 +505,7 @@ config UCLIBC_CTOR_DTOR
config LDSO_GNU_HASH_SUPPORT
bool "Enable GNU hash style support"
depends on HAVE_SHARED
depends on HAVE_SHARED && !TARGET_mips
help
Newest binutils support a new hash style named GNU-hash. The dynamic
linker will use the new GNU-hash section (.gnu.hash) for symbol lookup

View File

@ -1178,8 +1178,8 @@ int __dns_lookup(const char *name,
struct resolv_answer *a)
{
/* Protected by __resolv_lock: */
// static int last_ns_num = 0;
// static uint16_t last_id = 1;
static int last_ns_num = 0;
static uint16_t last_id = 1;
int i, j, fd, rc;
int packet_len;
@ -1258,12 +1258,12 @@ int __dns_lookup(const char *name,
}
/* first time? pick starting server etc */
if (local_ns_num < 0) {
local_id = 1;
local_id = last_id;
/*TODO: implement /etc/resolv.conf's "options rotate"
(a.k.a. RES_ROTATE bit in _res.options)
local_ns_num = 0;
if (_res.options & RES_ROTATE) */
local_ns_num = 0;
local_ns_num = last_ns_num;
retries_left = __nameservers * __resolv_attempts;
}
if (local_ns_num >= __nameservers)
@ -1271,8 +1271,8 @@ int __dns_lookup(const char *name,
local_id++;
local_id &= 0xffff;
/* write new values back while still under lock */
// last_id = local_id;
// last_ns_num = local_ns_num;
last_id = local_id;
last_ns_num = local_ns_num;
/* struct copy */
/* can't just take a pointer, __nameserver[x]
* is not safe to use outside of locks */

View File

@ -13,6 +13,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <sys/mman.h>
#include <malloc.h>
@ -28,6 +29,15 @@ void *malloc(size_t size)
size++;
}
/* prevent Undefined Behaviour for pointer arithmetic (substract) of too big pointers
* see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63303
* No need to check for size + sizeof(size_t) integer overflow since we already check for PTRDIFF_MAX
*/
if (unlikely(size > PTRDIFF_MAX)) {
__set_errno(ENOMEM);
return 0;
}
#ifdef __ARCH_USE_MMU__
# define MMAP_FLAGS MAP_PRIVATE | MAP_ANONYMOUS
#else
@ -148,6 +158,16 @@ void * memalign (size_t alignment, size_t size)
void * result;
unsigned long int adj;
if (unlikely(size > PTRDIFF_MAX)) {
__set_errno(ENOMEM);
return NULL;
}
if (unlikely((size + alignment - 1 < size) && (alignment != 0))) {
__set_errno(ENOMEM);
return NULL;
}
result = malloc (size + alignment - 1);
if (result == NULL)
return NULL;

View File

@ -6,6 +6,7 @@
#include <unistd.h>
#include <crypt.h>
#include <errno.h>
#include "libcrypt.h"
char *crypt(const char *key, const char *salt)
@ -26,7 +27,7 @@ char *crypt(const char *key, const char *salt)
return __sha512_crypt(ukey, usalt);
#endif
}
/* __set_errno(EINVAL);*/ /* ENOSYS might be misleading */
__set_errno(EINVAL);
return NULL;
}
return __des_crypt(ukey, usalt);