Commit ff875269 authored by Nikos Mavrogiannopoulos's avatar Nikos Mavrogiannopoulos

Merge branch 'tmp-updated-builders' into 'master'

.gitlab-ci.yml: updated builders to latest used by gnutls

Closes #6

See merge request !7
parents a4ac29b3 aacda36b
Pipeline #42259851 passed with stages
in 44 minutes and 57 seconds
variables:
BUILD_IMAGES_PROJECT: gnutls/build-images
FEDORA_BUILD: buildenv-f28
FEDORA_X86_BUILD: buildenv-f28-x86
FEDORA_BUILD: buildenv-f29
DEBIAN_X86_CROSS_BUILD: buildenv-debian-x86-cross
GET_SOURCES_ATTEMPTS: "3"
# See http://doc.gitlab.com/ce/ci/yaml/ for documentation.
......@@ -15,14 +15,34 @@ x86-64:
- shared
x86:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_X86_BUILD
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$DEBIAN_X86_CROSS_BUILD
script:
- git submodule update --init && make autoreconf &&
PKG_CONFIG_PATH="/usr/lib/pkgconfig/" CFLAGS="-O2 -g -m32" LDFLAGS="-m32" ./configure --build=i686-redhat-linux --target=i686-redhat-linux --disable-doc && make -j$(nproc) && make -j$(nproc) check
except:
- tags
- build=$(dpkg-architecture -qDEB_HOST_GNU_TYPE)
- host=i686-linux-gnu
- export CC_FOR_BUILD="gcc"
- export CC="$host-gcc"
- git submodule update --init && make autoreconf
- mkdir -p build
- cd build
- dash ../configure --build=$build --host=$host --disable-doc
- make -j$(nproc)
- make check -j$(nproc)
- cd ..
tags:
- shared
- docker
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- build/guile/tests/*.log
- build/*.log
- build/tests/*.log
- build/tests/*/*.log
- build/tests/suite/*/*.log
retry: 1
clang:
image: $CI_REGISTRY/$BUILD_IMAGES_PROJECT:$FEDORA_BUILD
......@@ -83,7 +103,7 @@ gnutls:
- ./configure --disable-doc --prefix=/usr --libdir=/usr/lib64 &&
make -j$(nproc) && make install
- git clone --depth 1 --branch master https://gitlab.com/gnutls/gnutls.git gnutls-git
- cd gnutls-git && git submodule update --init && make autoreconf &&
- cd gnutls-git && git submodule update --init && ./bootstrap &&
./configure --disable-cxx --disable-guile --disable-doc && make -j$(nproc) &&
make -j $(nproc) check
tags:
......@@ -113,6 +133,11 @@ static-analyzers:
- shared
except:
- tags
artifacts:
expire_in: 1 week
when: on_failure
paths:
- scan-build-lib/
# Target to run code coverage on non-master branches. That is intended
# to ensure that compilation in master will not break the pages rule.
......
......@@ -15,7 +15,7 @@ This manual is for GNU Libtasn1
which is a library for Abstract Syntax Notation One (ASN.1) and
Distinguished Encoding Rules (DER) manipulation.
Copyright @copyright{} 2001-2018 Free Software Foundation, Inc.
Copyright @copyright{} 2001-2019 Free Software Foundation, Inc.
@quotation
Permission is granted to copy, distribute and/or modify this document
......
This diff is collapsed.
......@@ -52,6 +52,15 @@ static const char *file_name; /* file to parse */
static void _asn1_yyerror (const char *);
static int _asn1_yylex(void);
#define SAFE_COPY(dst, dst_size, fmt, ...) { \
int _ret = snprintf(dst, dst_size, fmt, __VA_ARGS__); \
if (_ret != (int)strlen(dst)) \
{ \
fprintf(stderr, "%s:%u: Oversize value\n", \
file_name, line_number); \
exit(1); \
} \
}
%}
/* Prefix symbols and functions with _asn1_ */
......@@ -149,7 +158,7 @@ pos_num : NUM {snprintf($$,sizeof($$),"%s",$1);}
| '+' NUM {snprintf($$,sizeof($$),"%s",$2);}
;
neg_num : '-' NUM {snprintf($$,sizeof($$),"-%s",$2);}
neg_num : '-' NUM {SAFE_COPY($$,sizeof($$),"-%s",$2);}
;
pos_neg_num : pos_num {snprintf($$,sizeof($$),"%s",$1);}
......@@ -161,7 +170,7 @@ num_identifier : NUM {snprintf($$,sizeof($$),"%s",$1);}
;
int_identifier : NUM {snprintf($$,sizeof($$),"%s",$1);}
| '-' NUM {snprintf($$,sizeof($$),"-%s",$2);}
| '-' NUM {SAFE_COPY($$,sizeof($$),"-%s",$2);}
| IDENTIFIER {snprintf($$,sizeof($$),"%s",$1);}
;
......
......@@ -1062,7 +1062,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
{
case ASN1_ETYPE_NULL:
max_len--;
if (max_len >= 0)
if (der != NULL && max_len >= 0)
der[counter] = 0;
counter++;
move = RIGHT;
......@@ -1083,7 +1083,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
goto error;
}
max_len -= 2;
if (max_len >= 0)
if (der != NULL && max_len >= 0)
{
der[counter++] = 1;
if (p->value[0] == 'F')
......@@ -1119,7 +1119,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
goto error;
}
max_len -= len2 + len3;
if (max_len >= 0)
if (der != NULL && max_len >= 0)
memcpy (der + counter, p->value, len3 + len2);
counter += len3 + len2;
}
......@@ -1191,7 +1191,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
goto error;
}
max_len -= len2 + len3;
if (max_len >= 0)
if (der != NULL && max_len >= 0)
memcpy (der + counter, p->value, len3 + len2);
counter += len3 + len2;
move = RIGHT;
......@@ -1233,7 +1233,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
}
asn1_length_der (counter - len2, temp, &len3);
max_len -= len3;
if (max_len >= 0)
if (der != NULL && max_len >= 0)
{
memmove (der + len2 + len3, der + len2, counter - len2);
memcpy (der + len2, temp, len3);
......@@ -1274,7 +1274,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
}
asn1_length_der (counter - len2, temp, &len3);
max_len -= len3;
if (max_len >= 0)
if (der != NULL && max_len >= 0)
{
memmove (der + len2 + len3, der + len2, counter - len2);
memcpy (der + len2, temp, len3);
......@@ -1297,7 +1297,7 @@ asn1_der_coding (asn1_node element, const char *name, void *ider, int *len,
goto error;
}
max_len -= len2;
if (max_len >= 0 && der)
if (der != NULL && max_len >= 0)
memcpy (der + counter, p->value + len3, len2);
counter += len2;
move = RIGHT;
......
......@@ -716,6 +716,8 @@ _asn1_expand_object_id (asn1_node node)
{
p5 =
_asn1_add_single_node (ASN1_ETYPE_CONSTANT);
fprintf(stderr, "name: %s\n", p4->name);
fprintf(stderr, "value: %s\n", p4->value);
_asn1_set_name (p5, p4->name);
if (p4->value)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment