@@ -5483,7 +5483,8 @@ create_local_printer(
54835483 char name [128 ], /* Sanitized printer name */
54845484 * nameptr , /* Pointer into name */
54855485 uri [1024 ]; /* printer-uri-supported value */
5486- const char * ptr ; /* Pointer into attribute value */
5486+ const char * ptr , /* Pointer into attribute value */
5487+ * device_uri_ptr ; /* Pointer into device URI */
54875488 char scheme [HTTP_MAX_URI ], /* Scheme portion of URI */
54885489 userpass [HTTP_MAX_URI ], /* Username portion of URI */
54895490 host [HTTP_MAX_URI ], /* Host portion of URI */
@@ -5553,9 +5554,9 @@ create_local_printer(
55535554 return ;
55545555 }
55555556
5556- ptr = ippGetString (device_uri , 0 , NULL );
5557+ device_uri_ptr = ippGetString (device_uri , 0 , NULL );
55575558
5558- if (!ptr || !ptr [0 ] || (strncmp (ptr , "ipp://" , 6 ) && strncmp (ptr , "ipps://" , 7 )))
5559+ if (!device_uri_ptr || !device_uri_ptr [0 ] || (strncmp (device_uri_ptr , "dnssd://" , 8 ) && strncmp ( device_uri_ptr , " ipp://" , 6 ) && strncmp (device_uri_ptr , "ipps://" , 7 )))
55595560 {
55605561 send_ipp_status (con , IPP_STATUS_ERROR_NOT_POSSIBLE , _ ("Bad device-uri \"%s\"." ), ptr );
55615562
@@ -5579,7 +5580,7 @@ create_local_printer(
55795580
55805581 for (printer = (cupsd_printer_t * )cupsArrayGetFirst (Printers ); printer ; printer = (cupsd_printer_t * )cupsArrayGetNext (Printers ))
55815582 {
5582- if (printer -> device_uri && !strcmp (ptr , printer -> device_uri ))
5583+ if (printer -> device_uri && !strcmp (device_uri_ptr , printer -> device_uri ))
55835584 {
55845585 printer -> state_time = time (NULL );
55855586 send_ipp_status (con , IPP_STATUS_OK , _ ("Printer \"%s\" already exists." ), printer -> name );
0 commit comments