Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

load_photo crash when loading from old forwarded bot message #1074

Open
3bl3gamer opened this issue Apr 7, 2016 · 1 comment
Open

load_photo crash when loading from old forwarded bot message #1074

3bl3gamer opened this issue Apr 7, 2016 · 1 comment

Comments

@3bl3gamer
Copy link

Looks like bots clean up their messages after a month or two. If forwarded to a dialog, such message will remain in dialog, but as soon as original bot message is removed, official client will show comething like this:

get_message <id> on that message returns this:

{
  "id": "010000005c80fc03a31b0100000000004510d8a58edc3a47",
  "from": {...},
  "to": {...},
  "event": "message",
  "fwd_from": {"id": "$01000000a4f73b022fcdf4eec56f06b8", "peer_type": "user", "peer_id": 37484452, "print_name": "ImageSearch", "flags": 1, "last_name": "", "first_name": "ImageSearch", "username": "ImageSearchBot"},
  "fwd_date": 1450656733,
  "flags": 256,
  "out": false,
  "media": {"caption": "", "type": "photo"},
  "unread": false,
  "service": false,
  "date": 1450656738
}

but load_image <id> will crash telegram-cli: message is "media_photo" but has no photo, so here https://github.com/vysheng/tg/blob/master/interface.c#L1485 M->media.photo is NULL:

if (M->media.type == tgl_message_media_photo) { \
  tgl_do_load_photo (TLS, M->media.photo, actf, ev);\
} else

and then here https://github.com/vysheng/tgl/blob/master/queries.c#L3304 tgl_do_load_photo crashes because of null pointer.

@blaize9
Copy link

blaize9 commented May 24, 2016

@3bl3gamer I have submitted a pull request vysheng/tgl/pull#106 which would fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants