--- /dev/null
+@@
+expression q, n, m;
+@@
+- q = malloc((n)*(m))
++ q = malloc_multiply(n, m)
+@@
+expression q, n, m;
+@@
+- q = malloc(n*(m))
++ q = malloc_multiply(n, m)
+@@
+expression q, n, m;
+@@
+- q = malloc((n)*m)
++ q = malloc_multiply(n, m)
+@@
+expression q, n, m;
+@@
+- q = malloc(n*m)
++ q = malloc_multiply(n, m)
udev_list_init(udev, &file_list, true);
/* init token array and string buffer */
- rules->tokens = malloc(PREALLOC_TOKEN * sizeof(struct token));
+ rules->tokens = malloc_multiply(PREALLOC_TOKEN, sizeof(struct token));
if (rules->tokens == NULL)
return udev_rules_unref(rules);
rules->token_max = PREALLOC_TOKEN;
* requries 32 per glyph, regardless of the actual height - see the comment above #define
* max_font_size 65536 in drivers/tty/vt/vt.c for more details.
*/
- fontbuf = malloc((cfo.width + 7) / 8 * 32 * cfo.charcount);
+ fontbuf = malloc_multiply((cfo.width + 7) / 8 * 32, cfo.charcount);
if (!fontbuf) {
log_oom();
return;