TelegramMessenger / telemint

Telegram Auction Platform smart contracts
GNU General Public License v3.0
345 stars 71 forks source link

What will be if the domain contains 0? #28

Closed mytonwallet closed 2 years ago

mytonwallet commented 2 years ago

https://github.com/TelegramMessenger/telemint/blob/main/func/common.fc#L70 For example - codex0a\0test\0 -> codex will be resolved, but should be codex0a Potentially it is possible to forge domain, for example to create ton0a\0test\0 -> ton, but originaly must be only ton\0test\0 -> ton

arseny30 commented 2 years ago

I don't quite follow. The function splits the string by '\0' not by '0'. ASCII code of '0' is 48.

mytonwallet commented 2 years ago

https://github.com/TelegramMessenger/telemint/blob/main/func/common.fc#L75 Ok, but here is

need_break = char == 0;

Sorry, but how does it work then to understand that it is was 48?

Added: ok, I got it \0 equal NULL (0)

t\0n too attracts the glance, if would t0n, then another case