Skip to content

Commit c08c54e

Browse files
committed
Add empty common_name checks (Issue #125)
1 parent 3838053 commit c08c54e

3 files changed

Lines changed: 6 additions & 4 deletions

File tree

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ libcups v3.0.0 (YYYY-MM-DD)
1717
- Updated the `httpSetCookie` API to support multiple "Set-Cookie:" header
1818
values.
1919
- Updated `ippfind` to use the `cupsGetClock` API.
20+
- Fixed input checks for `cupsCreateCredentials` and
21+
`cupsCreateCredentialsRequest` APIs (Issue #125)
2022
- Fixed return values of `ippDateToTime` when the timezone isn't GMT.
2123
- Fixed a potential timing issue with `cupsEnumDests`.
2224
- Fixed a bug in the Avahi implementation of `cupsDNSSDBrowseNew`.

cups/tls-gnutls.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ cupsCreateCredentials(
205205
if (!path)
206206
path = http_default_path(defpath, sizeof(defpath));
207207

208-
if (!path || !common_name)
208+
if (!path || !common_name || !*common_name)
209209
{
210210
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
211211
goto done;
@@ -561,7 +561,7 @@ cupsCreateCredentialsRequest(
561561
if (!path)
562562
path = http_default_path(defpath, sizeof(defpath));
563563

564-
if (!path || !common_name)
564+
if (!path || !common_name || !*common_name)
565565
{
566566
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
567567
goto done;

cups/tls-openssl.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ cupsCreateCredentials(
290290
if (!path)
291291
path = http_default_path(defpath, sizeof(defpath));
292292

293-
if (!path || !common_name)
293+
if (!path || !common_name || !*common_name)
294294
{
295295
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
296296
return (false);
@@ -606,7 +606,7 @@ cupsCreateCredentialsRequest(
606606
if (!path)
607607
path = http_default_path(temp, sizeof(temp));
608608

609-
if (!path || !common_name)
609+
if (!path || !common_name || !*common_name)
610610
{
611611
_cupsSetError(IPP_STATUS_ERROR_INTERNAL, strerror(EINVAL), 0);
612612
return (false);

0 commit comments

Comments
 (0)