From a46c4443e352d9eada02670125ea5f028559be21 Mon Sep 17 00:00:00 2001 From: Michael Vetter Date: Wed, 30 Jun 2021 12:27:11 +0200 Subject: Fix segfault when aesgcm url isn't the expected size Fixes the bug mentioned in https://github.com/profanity-im/profanity/issues/1478#issuecomment-794161606 The rest of https://github.com/profanity-im/profanity/issues/1478 I can't reproduce. Seems to work fine. --- src/tools/aesgcm_download.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/tools') diff --git a/src/tools/aesgcm_download.c b/src/tools/aesgcm_download.c index 864da6b7..45aa7b66 100644 --- a/src/tools/aesgcm_download.c +++ b/src/tools/aesgcm_download.c @@ -70,6 +70,7 @@ aesgcm_file_get(void* userdata) // Convert the aesgcm:// URL to a https:// URL and extract the encoded key // and tag stored in the URL fragment. if (omemo_parse_aesgcm_url(aesgcm_dl->url, &https_url, &fragment) != 0) { + cons_show_error("Download failed: Cannot parse URL '%s'.", aesgcm_dl->url); http_print_transfer_update(aesgcm_dl->window, aesgcm_dl->url, "Download failed: Cannot parse URL '%s'.", aesgcm_dl->url); -- cgit 1.4.1-2-gfad0 ty.Kartik K. Agaram <vc@akkartik.com>
about summary refs log blame commit diff stats
path: root/archive/0.vm.arc/buffered-stdin.mu
blob: 9a7bc7ae8934454945591890f2b460ddeab77a37 (plain) (tree)
1
2
3
4
5
6
7
8
9
                                                    


                                                               
                    


                                                                                                                      
                
                                                            
                                                                                                                          
         



                                                                
                                                                                                  
                                                                    


                                         



                                                                     


          
; reads lines, prints them back when you hit 'enter'
; dies if you wait a while, because so far we never free memory
(function main [
  (default-space:space-address <- new space:literal 30:literal)
  (cursor-mode) ;? 1
  ; hook up stdin
  (stdin:channel-address <- init-channel 1:literal)
  (fork-helper send-keys-to-stdin:fn nil:literal/globals nil:literal/limit nil:literal/keyboard stdin:channel-address)
  ; buffer stdin
  (buffered-stdin:channel-address <- init-channel 1:literal)
  (fork-helper buffer-lines:fn nil:literal/globals nil:literal/limit stdin:channel-address buffered-stdin:channel-address)
  { begin
    ; now read characters from the buffer until 'enter' is typed
    (s:string-address <- new "? ")
    (print-string nil:literal/terminal s:string-address)
    { begin
      (x:tagged-value buffered-stdin:channel-address/deref <- read buffered-stdin:channel-address)
      (c:character <- maybe-coerce x:tagged-value character:literal)
;?       ($print (("AAA " literal))) ;? 1
;?       ($print c:character) ;? 1
;?       ($print (("\n" literal))) ;? 1
      (print-character nil:literal/terminal c:character)
      (line-done?:boolean <- equal c:character ((#\newline literal)))
      (loop-unless line-done?:boolean)
    }
    (loop)
  }
])