Skip to content

Commit

Permalink
Merge branch 'main' into coverity
Browse files Browse the repository at this point in the history
  • Loading branch information
sreimers committed Aug 30, 2023
2 parents fa5eb3e + b5ca0e2 commit e41598f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
4 changes: 1 addition & 3 deletions include/re_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,10 @@ typedef int re_sock_t;
if (likely((safe))) { \
size_t sz = va_arg((ap), size_t); \
if (unlikely(!sz)) { \
re_assert(0 && "RE_VA_ARG: no more arguments"); \
err = EOVERFLOW; \
err = ENODATA; \
goto out; \
} \
if (unlikely(sz != sizeof(type))) { \
re_assert(0 && "RE_VA_ARG: arg is not compatible"); \
err = EOVERFLOW; \
goto out; \
} \
Expand Down
16 changes: 15 additions & 1 deletion src/fmt/print.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
* Copyright (C) 2010 Creytiv.com
*/
#include <string.h>
#include <math.h>
#include <re_types.h>
#include <re_sa.h>
#include <re_fmt.h>
#include <re_mem.h>
#include <math.h>
#ifdef _MSC_VER
#include <float.h>
#ifndef isinf
Expand All @@ -26,6 +26,9 @@
#define isnan(a) isnand((a))
#endif

#define DEBUG_MODULE "print"
#define DEBUG_LEVEL 5
#include <re_dbg.h>

enum length_modifier {
LENMOD_NONE = 0,
Expand Down Expand Up @@ -489,6 +492,17 @@ static int vhprintf(const char *fmt, va_list ap, re_vprintf_h *vph, void *arg,
err |= vph(p0, p - p0, arg);

out:
#ifndef RELEASE
if (err == ENODATA) {
DEBUG_WARNING("Format: \"%b<-- NO ARG\n", fmt, p - fmt + 1);
re_assert(0 && "RE_VA_ARG: no more arguments");
}
if (err == EOVERFLOW) {
DEBUG_WARNING("Format: \"%b<-- SIZE ERROR\n", fmt,
p - fmt + 1);
re_assert(0 && "RE_VA_ARG: arg is not compatible");
}
#endif
return err;
}

Expand Down
2 changes: 2 additions & 0 deletions src/sip/request.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ static int request(struct sip_request *req, enum sip_transp tp,
if (req->srcport) {
struct sip_conncfg cfg = {.srcport = req->srcport};
err = sip_conncfg_set(req->sip, dst, &cfg);
if (err)
goto out;
}

if (!req->stateful) {
Expand Down

0 comments on commit e41598f

Please sign in to comment.