It is possible for format to be NULL (as described in the function signature) which causes a segmentation fault when it is passed to strcmp. This patch changes the conditional to short-circuit if format is NULL and only call strcmp otherwise.
fputs("DEBUG: Adding all operation/job attributes.\n", stderr);
num_options = adjust_options(num_options, &options);
- if (!strcmp(format, "image/pwg-raster") || !strcmp(format, "image/urf"))
+ if (format && (!strcmp(format, "image/pwg-raster") || !strcmp(format, "image/urf")))
num_options = cupsRemoveOption("copies", num_options, &options);
cupsEncodeOptions2(request, num_options, options, IPP_TAG_OPERATION);