Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix bug not allocating enough bytes for the playlist URI when convert…

…ing to JSON
  • Loading branch information...
commit 9310752ecb0aa3d5f5d5e2ae0cde002c70cf1999 1 parent a135cbc
@liesen authored
Showing with 3 additions and 3 deletions.
  1. +3 −3 json.c
View
6 json.c
@@ -41,9 +41,9 @@ json_t *playlist_to_json(sp_playlist *playlist, json_t *object) {
json_string_nocheck(username));
// URI
- size_t playlist_uri_len = strlen("spotify:user:") + strlen(username) +
- strlen(":playlist:") +
- strlen("284on3DVWeAxWkgVuzZKGt") + 1;
+ size_t playlist_uri_len = sizeof("spotify:user:") + sizeof(username) +
+ sizeof(":playlist:") +
+ sizeof("284on3DVWeAxWkgVuzZKGt") + 1;
char *playlist_uri = malloc(playlist_uri_len);
if (playlist_uri == NULL)
Please sign in to comment.
Something went wrong with that request. Please try again.