In any case cups.socket and cups.path are stopped and disabled now because cautious clean up would leave a messsed up systemd setup for cupsd when YaST was used before (bnc#857372) plus CUPS upstream fix for STR #4351 cups-lpd hugh jobs (>2G) fail (bnc#864782) OBS-URL: https://build.opensuse.org/request/show/223231 OBS-URL: https://build.opensuse.org/package/show/Printing/cups?expand=0&rev=279
37 lines
1.2 KiB
Diff
37 lines
1.2 KiB
Diff
Index: scheduler/cups-lpd.c
|
|
===================================================================
|
|
--- scheduler/cups-lpd.c (revision 11557)
|
|
+++ scheduler/cups-lpd.c (revision 11558)
|
|
@@ -781,7 +770,8 @@
|
|
int fd; /* Temporary file */
|
|
FILE *fp; /* File pointer */
|
|
char filename[1024]; /* Temporary filename */
|
|
- int bytes; /* Bytes received */
|
|
+ ssize_t bytes; /* Bytes received */
|
|
+ size_t total; /* Total bytes */
|
|
char line[256], /* Line from file/stdin */
|
|
command, /* Command from line */
|
|
*count, /* Number of bytes */
|
|
@@ -965,15 +955,15 @@
|
|
* Copy the data or control file from the client...
|
|
*/
|
|
|
|
- for (i = atoi(count); i > 0; i -= bytes)
|
|
+ for (total = (size_t)strtoll(count, NULL, 10); total > 0; total -= (size_t)bytes)
|
|
{
|
|
- if (i > sizeof(line))
|
|
- bytes = sizeof(line);
|
|
+ if (total > sizeof(line))
|
|
+ bytes = (ssize_t)sizeof(line);
|
|
else
|
|
- bytes = i;
|
|
+ bytes = (ssize_t)total;
|
|
|
|
- if ((bytes = fread(line, 1, bytes, stdin)) > 0)
|
|
- bytes = write(fd, line, bytes);
|
|
+ if ((bytes = (ssize_t)fread(line, 1, (size_t)bytes, stdin)) > 0)
|
|
+ bytes = write(fd, line, (size_t)bytes);
|
|
|
|
if (bytes < 1)
|
|
{
|