asn1_der_coding: added extra checks to avoid copying on null variable

The existing checks were sufficient on normal input, but improved for
some illegal input. Detected by static analyzer.

Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
9 jobs for tmp-updated-builders in 41 minutes and 13 seconds
Status Job ID Name Coverage
  Test
passed #141877569
shared docker
MinGW32

00:05:42

passed #141877567
shared
asan

00:04:58

passed #141877566
shared
clang

00:04:48

passed #141877570
shared
gnutls

00:41:12

passed #141877572
shared
pages-test

00:03:56

passed #141877571
shared
static-analyzers

00:05:35

passed #141877568
shared
ubsan

00:04:33

passed #141877565
shared docker
x86

00:02:04

passed #141877564
shared
x86-64

00:04:42