Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4E4F5200C1E for ; Fri, 3 Feb 2017 04:17:57 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4CE6F160B61; Fri, 3 Feb 2017 03:17:57 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 950DE160B57 for ; Fri, 3 Feb 2017 04:17:56 +0100 (CET) Received: (qmail 91534 invoked by uid 500); 3 Feb 2017 03:17:55 -0000 Mailing-List: contact commits-help@guacamole.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@guacamole.incubator.apache.org Delivered-To: mailing list commits@guacamole.incubator.apache.org Received: (qmail 91524 invoked by uid 99); 3 Feb 2017 03:17:55 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 03 Feb 2017 03:17:55 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 7D4A71857EC for ; Fri, 3 Feb 2017 03:17:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -1.999 X-Spam-Level: X-Spam-Status: No, score=-1.999 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RP_MATCHES_RCVD=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id nQEsu0g0MaGo for ; Fri, 3 Feb 2017 03:17:53 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id BA40F5FB0F for ; Fri, 3 Feb 2017 03:17:52 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id DE81CE023B for ; Fri, 3 Feb 2017 03:17:51 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 868B42528A for ; Fri, 3 Feb 2017 03:17:51 +0000 (UTC) Date: Fri, 3 Feb 2017 03:17:51 +0000 (UTC) From: "Michael Jumper (JIRA)" To: commits@guacamole.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Resolved] (GUACAMOLE-149) Potential busy loop in guac_terminal_display_set_columns() MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Fri, 03 Feb 2017 03:17:57 -0000 [ https://issues.apache.org/jira/browse/GUACAMOLE-149?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Michael Jumper resolved GUACAMOLE-149. -------------------------------------- Resolution: Fixed > Potential busy loop in guac_terminal_display_set_columns() > ---------------------------------------------------------- > > Key: GUACAMOLE-149 > URL: https://issues.apache.org/jira/browse/GUACAMOLE-149 > Project: Guacamole > Issue Type: Bug > Components: guacamole-server, SSH, Telnet > Affects Versions: 0.9.9, 0.9.10-incubating > Reporter: Aiden Luo > Assignee: Michael Jumper > Priority: Critical > Fix For: 0.9.12-incubating > > > The Guacamole terminal emulator can get caught in an endless busy loop if a character in the buffer ends up being set with zero width. The loop within {{guac_terminal_display_set_columns()}} advances through columns by the width of the current character, and will never advance if that width is somehow unset. > {code:none} > (gdb) bt > #0 guac_terminal_display_set_columns (display=0x30f5480, row=11, start_column=22, end_column=22, character=0x2cf3b18) > at display.c:458 > #1 0x00007f8b3fa68374 in guac_terminal_commit_cursor (term=term@entry=0x2c0b5b0) at terminal.c:649 > #2 0x00007f8b3fa69329 in guac_terminal_flush (terminal=terminal@entry=0x2c0b5b0) at terminal.c:1339 > #3 0x00007f8b3fa69440 in guac_terminal_render_frame (terminal=0x2c0b5b0) at terminal.c:489 > #4 0x000000000040312d in __guacd_client_output_thread (data=0x2bea930) at client.c:73 > #5 0x00007f8b43469184 in start_thread (arg=0x7f8b3c326700) at pthread_create.c:312 > #6 0x00007f8b4319637d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111 > (gdb) f 0 > #0 guac_terminal_display_set_columns (display=0x30f5480, row=11, start_column=22, end_column=22, character=0x2cf3b18) > at display.c:458 > 458 current->type = GUAC_CHAR_SET; > (gdb) list > 453 > 454 /* For each column in range */ > 455 for (i = start_column; i <= end_column; i += character->width) { > 456 > 457 /* Set operation */ > 458 current->type = GUAC_CHAR_SET; > 459 current->character = *character; > 460 > 461 /* Next character */ > 462 current += character->width; > (gdb) p character->width > $113 = 0 > (gdb) > {code} > From {{__guac_terminal_set()}}, it's clear that having zero width is a legitimate value: > {code:none} > /* Calculate width in columns */ > width = wcwidth(codepoint); > if (width < 0) > width = 1; > /* Do nothing if glyph is empty */ > if (width == 0) > return 0; > {code} -- This message was sent by Atlassian JIRA (v6.3.15#6346)