Re: [RFC][PATCH] libtraceeval: Add size checks to insert and query functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 15 Aug 2023 21:10:52 -0400
Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

> > +#define traceeval_insert(teval, keys, vals)				\
> > +	traceeval_insert_size(teval, keys, sizeof(keys) / sizeof(keys[0]), \
> > +			      vals, sizeof(vals) / sizeof(vals[0]))
> >    
> 
> I just realized that vals may be NULL, so the above needs to be:
> 
> #define traceeval_insert(teval, keys, vals)				\
> 	traceeval_insert_size(teval, keys, sizeof(keys) / sizeof(keys[0]), \
> 			      vals, vals ? sizeof(vals) / sizeof(vals[0]) : 0)

Nevermind. NULL won't compile (and neither will the above).

-- Steve



[Index of Archives]     [Linux USB Development]     [Linux USB Development]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux