fix a few gcc 11 -fanalyzer complaints

This commit is contained in:
leitner
2021-04-27 17:54:31 +00:00
parent 1cb3d7807a
commit e29be46197
6 changed files with 12 additions and 8 deletions

1
acl.c
View File

@@ -312,6 +312,7 @@ int marshal(const char* map,size_t filelen,const char* filename) {
}
F=malloc(sizeof(*F)*(filters+1));
if (!F) goto nomem;
filter_offset=filelen+(filters+4)*sizeof(*F); /* 2 uints for index header, 1 uint filters_count, then filter_count+1 uint32 in F */

1
auth.c
View File

@@ -1,4 +1,5 @@
#define _XOPEN_SOURCE
#define _DEFAULT_SOURCE
#include <sys/types.h>
#ifdef __dietlibc__
#include <md5.h>

View File

@@ -19,7 +19,7 @@
size_t fmt_ldapsubstring(char* dest,const struct Substring* s) {
size_t sum=0,tmp=0;
while (s) {
tmp=fmt_asn1string(dest,PRIVATE,PRIMITIVE,s->substrtype,s->s.s,s->s.l);
tmp=fmt_asn1string(dest,PRIVATE,PRIMITIVE,(enum asn1_tag)s->substrtype,s->s.s,s->s.l);
if (dest) dest+=tmp;
sum+=tmp;
s=s->next;

View File

@@ -1,10 +1,10 @@
#include <stdlib.h>
#include <stdio.h>
#include "asn1.h"
#include "str.h"
#include "textcode.h"
#include "fmt.h"
#include "byte.h"
#include "libowfat/str.h"
#include "libowfat/textcode.h"
#include "libowfat/fmt.h"
#include "libowfat/byte.h"
struct x509signature {
struct string oid; /* you are not expected to actually decode this */
@@ -362,7 +362,7 @@ size_t scan_certificate(const char* cert, size_t l, struct x509cert* C, char** f
}
#include "mmap.h"
#include "libowfat/mmap.h"
#include <stdio.h>
#include "printasn1.c"

View File

@@ -36,7 +36,7 @@ size_t scan_ldapaddrequest(const char* src,const char* max,struct AddRequest* a)
} else {
last=&a->a;
}
last->next=0;
byte_zero(last, sizeof(*last));
if (!(tmp=scan_asn1SEQUENCE(src+res,max,&islen)))
goto error;
res+=tmp;

View File

@@ -1,3 +1,4 @@
#define _GNU_SOURCE
#define _FILE_OFFSET_BITS 64
#include <unistd.h>
#include <stdlib.h>
@@ -405,7 +406,8 @@ mergesub:
buffer_put(buffer_2,f->ava.desc.s,f->ava.desc.l);
buffer_puts(buffer_2," has ");
while (s) {
if (!first) buffer_puts(buffer_2," and "); first=0;
if (!first) buffer_puts(buffer_2," and ");
first=0;
switch(s->substrtype) {
case prefix: buffer_puts(buffer_2,"prefix \""); break;
case any: buffer_puts(buffer_2,"substr \""); break;