Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
access: coverity - handle negative value from base64_decode()
  • Loading branch information
perexg committed Oct 3, 2014
1 parent cb2e797 commit a97c73d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/access.c
Expand Up @@ -914,6 +914,8 @@ access_entry_class_password2_set(void *o, const void *v)
if (strcmp(v ?: "", ae->ae_password2 ?: "")) {
if (v && ((const char *)v)[0] != '\0') {
l = base64_decode((uint8_t *)result, v, sizeof(result)-1);
if (l < 0)
l = 0;
result[l] = '\0';
free(ae->ae_password);
ae->ae_password = strdup(result + 15);
Expand Down

0 comments on commit a97c73d

Please sign in to comment.