- graphviz-2.42.2-coverity-scan-fixes.patch
- graphviz-2.42.2-dotty-menu-fix.patch
- graphviz-2.42.2-ocaml-allow-const-cast.patch
-- some allocation failures that could previously allow memory corruption now exit
### Fixed
- Released Ubuntu packages does not contain language bindings for Python3 #1737
int clustering_method;
} opts_t;
+#if 0
+void *gmalloc(size_t nbytes)
+{
+ char *rv;
+ if (nbytes == 0)
+ return NULL;
+ rv = malloc(nbytes);
+ if (rv == NULL) {
+ fprintf(stderr, "out of memory\n");
+ abort();
+ }
+ return rv;
+}
+
+void *grealloc(void *ptr, size_t size)
+{
+ void *p = realloc(ptr, size);
+ if (p == NULL && size) {
+ fprintf(stderr, "out of memory\n");
+ abort();
+ }
+ return p;
+}
+
+#endif
+
static char* usestr =
" -C k - generate no more than k clusters (0)\n\
0 : no limit\n\
enum {MAX_GRPS = 10000};
static char swork[maxlen];
+#if 0
+void *gmalloc(size_t nbytes)
+{
+ char *rv;
+ if (nbytes == 0)
+ return NULL;
+ rv = malloc(nbytes);
+ if (rv == NULL) {
+ fprintf(stderr, "out of memory\n");
+ abort();
+ }
+ return rv;
+}
+
+void *grealloc(void *ptr, size_t size)
+{
+ void *p = realloc(ptr, size);
+ if (p == NULL && size) {
+ fprintf(stderr, "out of memory\n");
+ abort();
+ }
+ return p;
+}
+
+#endif
+
typedef struct {
char* cmd;
char **infiles;
#include <stdlib.h>
#include "cgraph.h"
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
#define NEW(t) (t*)malloc(sizeof(t))
typedef struct {
#include <string.h>
#define NEW(t) (t*)malloc(sizeof(t))
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
#include "cgraph.h"
#include "cghdr.h"
#include <getopt.h>
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
static int Verbose;
static char* gname = "";
#include <assert.h>
#define NEW(t) (t*)malloc(sizeof(t))
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
#define RALLOC(size,ptr,type) ((type*)realloc(ptr,(size)*sizeof(type)))
typedef unsigned short ushort;
};
#define NEW(t) (t*)malloc(sizeof(t))
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
/* Round x up to next multiple of y, which is a power of 2 */
#define ROUND2(x,y) (((x) + ((y)-1)) & ~((y)-1))
#define SMALLBUF 128
#define NEW(t) (t*)malloc(sizeof(t))
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
#define EMPTY(s) ((s == 0) || (*s == '\0'))
#define SLEN(s) (sizeof(s)-1)
};
#define NEW(t) (t*)malloc(sizeof(t))
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
/* Round x up to next multiple of y, which is a power of 2 */
#define ROUND2(x,y) (((x) + ((y)-1)) & ~((y)-1))
#include <stdlib.h>
#define NEW(t) (t*)malloc(sizeof(t))
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
typedef struct {
unsigned char on_stack;
#include <string.h>
#include <agxbuf.h>
-#define N_GNEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_GNEW(n,t) (t*)malloc((n)*sizeof(t))
/* agxbinit:
* Assume if init is non-null, hint = sizeof(init[])
#include "config.h"
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "memory.h"
void *zmalloc(size_t nbytes)
{
+ char *rv;
if (nbytes == 0)
return 0;
- return gcalloc(1, nbytes);
+ rv = gmalloc(nbytes);
+ memset(rv, 0, nbytes);
+ return rv;
}
void *zrealloc(void *ptr, size_t size, size_t elt, size_t osize)
void *p = realloc(ptr, size * elt);
if (p == NULL && size) {
fprintf(stderr, "out of memory\n");
- exit(EXIT_FAILURE);
+ return p;
}
if (osize < size)
memset((char *) p + (osize * elt), '\0', (size - osize) * elt);
return p;
}
-void *gcalloc(size_t nmemb, size_t size)
-{
- char *rv = calloc(nmemb, size);
- if (rv == NULL) {
- fprintf(stderr, "out of memory\n");
- exit(EXIT_FAILURE);
- }
- return rv;
-}
-
void *gmalloc(size_t nbytes)
{
char *rv;
rv = malloc(nbytes);
if (rv == NULL) {
fprintf(stderr, "out of memory\n");
- exit(EXIT_FAILURE);
}
return rv;
}
void *p = realloc(ptr, size);
if (p == NULL && size) {
fprintf(stderr, "out of memory\n");
- exit(EXIT_FAILURE);
}
return p;
}
#endif
#define NEW(t) (t*)zmalloc(sizeof(t))
-#define N_NEW(n,t) (t*)gcalloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)zmalloc((n)*sizeof(t))
#define GNEW(t) (t*)gmalloc(sizeof(t))
-#define N_GNEW(n,t) (t*)gcalloc((n),sizeof(t))
-#define N_GGNEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_GNEW(n,t) (t*)gmalloc((n)*sizeof(t))
+#define N_GGNEW(n,t) (t*)malloc((n)*sizeof(t))
#define ALLOC(size,ptr,type) (ptr? (type*)grealloc(ptr,(size)*sizeof(type)):(type*)gmalloc((size)*sizeof(type)))
#define RALLOC(size,ptr,type) ((type*)grealloc(ptr,(size)*sizeof(type)))
#define ZALLOC(size,ptr,type,osize) (ptr? (type*)zrealloc(ptr,size,sizeof(type),osize):(type*)zmalloc((size)*sizeof(type)))
extern void *zmalloc(size_t);
extern void *zrealloc(void *, size_t, size_t, size_t);
- extern void *gcalloc(size_t nmemb, size_t size);
extern void *gmalloc(size_t);
extern void *grealloc(void *, size_t);
#undef extern
#include "render.h"
#include "pathplan.h"
#include <setjmp.h>
-#include <stdlib.h>
#ifdef UNUSED
static box *bs = NULL;
routesplinesinit()
{
if (++routeinit > 1) return 0;
- if (!(ps = calloc(PINC, sizeof(pointf)))) {
+ if (!(ps = N_GNEW(PINC, pointf))) {
agerr(AGERR, "routesplinesinit: cannot allocate ps\n");
return 1;
}
{
if (size > maxpn) {
int newmax = maxpn + (size / PINC + 1) * PINC;
- ps = realloc(ps, newmax * sizeof(pointf));
+ ps = RALLOC(newmax, ps, pointf);
if (!ps) {
agerr(AGERR, "cannot re-allocate ps\n");
return 1;
if (sp->curp == sp->curblk->endp) {
if (sp->curblk->next == NULL) {
blk_t *bp = NEW(blk_t);
+ if (bp == 0) {
+ agerr(AGERR, "gc: Out of memory\n");
+ }
bp->prev = sp->curblk;
bp->next = NULL;
bp->data = N_NEW(BIGBUF, Agnode_t *);
+ if (bp->data == 0) {
+ agerr(AGERR, "dot: Out of memory\n");
+ }
bp->endp = bp->data + BIGBUF;
sp->curblk->next = bp;
}
{
LeafList_t *llp;
- if ((llp = calloc(1, sizeof(LeafList_t)))) {
+ if ((llp = NEW(LeafList_t))) {
llp->leaf = lp;
llp->next = 0;
}
*/
static struct ListNode *RTreeNewListNode(void)
{
- return calloc(1, sizeof(struct ListNode));
+ return NEW(struct ListNode);
}
#if UNUSED
{
RTree_t *rtp;
- if ((rtp = calloc(1, sizeof(RTree_t))))
+ if ((rtp = NEW(RTree_t)))
rtp->root = RTreeNewIndex(rtp);
return rtp;
}
return 1;
}
}
+
+#ifdef UNUSED
+/* Allocate space for a node in the list used in DeletRect to
+** store Nodes that are too empty.
+*/
+struct ListNode *NewListNode()
+{
+ return (struct ListNode *) NEW(sizeof(struct ListNode));
+}
+
+#endif
#include <ctype.h>
#include <setjmp.h>
-#include <stdlib.h>
#include "render.h"
#include "pack.h"
{
if (sp->curp == sp->curblk->endp) {
if (sp->curblk->next == NULL) {
- blk_t *bp = malloc(sizeof(blk_t));
+ blk_t *bp = GNEW(blk_t);
if (bp == 0) {
agerr(AGERR, "gc: Out of memory\n");
longjmp(jbuf, 1);
}
bp->prev = sp->curblk;
bp->next = NULL;
- bp->data = calloc(BIGBUF, sizeof(Agnode_t *));
+ bp->data = N_GNEW(BIGBUF, Agnode_t *);
if (bp->data == 0) {
agerr(AGERR, "gc: Out of memory\n");
longjmp(jbuf, 1);
if (len + 25 <= buflen)
name = buf;
else {
- name = (char *) gmalloc(len + 25);
+ if (!(name = (char *) gmalloc(len + 25))) return NULL;
}
strcpy(name, pfx);
*lenp = len;
#include <time.h>
#include <string.h>
#include <math.h>
-#include <stdlib.h>
#include "types.h"
#include "memory.h"
Lwdd = SparseMatrix_copy(Lwd);
m = Lw->m;
- x0 = calloc(dim*m, sizeof(real));
+ x0 = N_GNEW(dim*m,real);
if (!x0) goto RETURN;
memcpy(x0, x, sizeof(real)*dim*m);
- y = calloc(dim*m, sizeof(real));
+ y = N_GNEW(dim*m,real);
if (!y) goto RETURN;
id = Lwd->ia; jd = Lwd->ja;
#define MALLOC malloc
#define REALLOC realloc
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
#define NEW(t) (t*)malloc(sizeof(t))
#define MAX(a,b) ((a)>(b)?(a):b)
#define MIN(a,b) ((a)<(b)?(a):b)
} availfont_t;
#define NEW(t) (t*)malloc(sizeof(t))
-#define N_NEW(n,t) (t*)calloc((n),sizeof(t))
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
static PostscriptAlias postscript_alias[] = {
#include "ps_font_equiv.h"
#include <pango/pangofc-font.h>
#endif
+#define N_NEW(n,t) (t*)malloc((n)*sizeof(t))
+
static void pango_free_layout (void *layout)
{
g_object_unref((PangoLayout*)layout);