Skip to content
Browse files

Before we autolink username make sure that the length is > 1 which wi…

…ll imply it is not just a ~ character.
  • Loading branch information...
1 parent 09f28f6 commit 467c55e6ce2e84d8649e664283a7c32d97384f16 @Zariel committed
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/autolink.c
View
7 src/autolink.c
@@ -300,8 +300,11 @@ sd_autolink__username(size_t *rewind_p, struct buf *link, uint8_t *data, size_t
if (size < 1)
return 0;
- /* make sure it starts with ~ */
- if (data[0] != '~')
+ /*
+ * make sure it starts with ~
+ * And that it is not just a ~
+ * */
+ if (data[0] != '~' && size > 1)
return 0;
link_end = 1;

0 comments on commit 467c55e

Please sign in to comment.
Something went wrong with that request. Please try again.