Skip to content

Commit

Permalink
10305 print: NULL pointer errors
Browse files Browse the repository at this point in the history
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Gergő Mihály Doma <domag02@gmail.com>
Approved by: Dan McDonald <danmcd@joyent.com>
  • Loading branch information
tsoome authored and Dan McDonald committed Feb 4, 2019
1 parent 4f6502b commit 5243e33
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion usr/src/cmd/print/bsd-sysv-commands/cancel.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ main(int ac, char *av[])
/* Remove first job from printer */

status = papiPrinterListJobs(svc, printer,
NULL, NULL, 0, &jobs);
NULL, 0, 0, &jobs);

if (status != PAPI_OK) {
fprintf(stderr, gettext(
Expand Down
4 changes: 2 additions & 2 deletions usr/src/cmd/print/bsd-sysv-commands/in.lpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static papi_attribute_t **
parse_cf(papi_service_t svc, char *cf, char **files)
{
papi_attribute_t **list = NULL;
char previous = NULL;
char previous = '\0';
char *entry;
int copies_set = 0;
int copies = 0;
Expand Down Expand Up @@ -509,7 +509,7 @@ berkeley_receive_files(papi_service_t svc, FILE *ifp, FILE *ofp, char *printer)
case 0x02: { /* Receive control file */
if (((cf = strchr(buf, ' ')) != NULL) &&
(strlen(cf) > 4)) {
while ((*cf != NULL) && (isdigit(*cf) == 0))
while ((*cf != '\0') && (isdigit(*cf) == 0))
cf++;
rid = atoi(cf);
}
Expand Down
4 changes: 1 addition & 3 deletions usr/src/cmd/print/conv_fix/conv_fix.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
* Use is subject to license terms.
*/

#pragma ident "%Z%%M% %I% %E% SMI"

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -64,7 +62,7 @@ _file_getline(FILE *fp)
continue;
} else {
if ((*tmp == '#') || (*tmp == '\n')) {
*tmp = NULL;
*tmp = '\0';
break;
}

Expand Down
8 changes: 4 additions & 4 deletions usr/src/cmd/print/lpset/lpset.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,18 +273,18 @@ main(int ac, char *av[])

key = *(changes++);

for (p = key; ((p != NULL) && (*p != NULL)); p++)
for (p = key; ((p != NULL) && (*p != '\0')); p++)
if (*p == '=') {
*p = NULL;
*p = '\0';
value = ++p;
break;
} else if (*p == '\\')
p++;

if ((value != NULL) && (*value == NULL))
if ((value != NULL) && (*value == '\0'))
value = NULL;

if ((key != NULL) && (key[0] != NULL)) {
if ((key != NULL) && (key[0] != '\0')) {
if ((value == NULL) &&
(ns_get_value(key, printer_obj) == NULL) &&
(has_equals == 0)) {
Expand Down

0 comments on commit 5243e33

Please sign in to comment.