Skip to content

Commit fa4961e

Browse files
andy5995claude
andcommitted
fix: check for NULL return from g_uri_escape_string in escape_url
g_uri_escape_string returns NULL for invalid UTF-8 input; guard it with fatal_malloc() to match the existing check in unescape_url. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 9b5052f commit fa4961e

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/utils.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,10 @@ user_verify(void)
180180
char *
181181
escape_url(const char *str)
182182
{
183-
return (char *) g_uri_escape_string(str, "/", FALSE);
183+
char *result = (char *) g_uri_escape_string(str, "/", FALSE);
184+
if (!result)
185+
fatal_malloc();
186+
return result;
184187
}
185188

186189

0 commit comments

Comments
 (0)