Project

General

Profile

Actions

Review #751

closed

Fix /BIP commands truncating output

Added by Loïc Gomez almost 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Target version:
Start date:
2022-01-05
Branch:

Description

/BIP list connections and such will truncate output without notifying the user because we use snprintf().
We can use memccpy() instead, in order to respect max line length while not truncating text, and being able to start a new line when required.
https://developers.redhat.com/blog/2019/08/12/efficient-string-copying-and-concatenation-in-c#choosing_a_solution

This will also alleviate work required in #750


Files

memccpy_poc.c (1.26 KB) memccpy_poc.c PoC for bip_strcat_fit() and bip_strcatf_fit() Loïc Gomez, 2022-01-05 17:29
0001-fix-bip-user-info-command.patch (857 Bytes) 0001-fix-bip-user-info-command.patch Fix /BIP user info command Loïc Gomez, 2022-01-10 19:20
0002-Move-BIP-commands-to-bip_strcat-f-_fit-memccpy-wrapp.patch (19.6 KB) 0002-Move-BIP-commands-to-bip_strcat-f-_fit-memccpy-wrapp.patch Do not truncate output Loïc Gomez, 2022-01-10 19:21
0003-sanitize-bip_strcat-f-_fit-cleanup.patch (2.67 KB) 0003-sanitize-bip_strcat-f-_fit-cleanup.patch Better code for previous patch (strict cflags etc.) Loïc Gomez, 2022-01-10 19:21

Related issues 1 (0 open1 closed)

Related to Bip - Enhancement #750: Compile BIP with secure flagsResolvedLoïc Gomez2022-01-12

Actions
Actions #1

Updated by Loïc Gomez almost 3 years ago

Actions #2

Updated by Loïc Gomez almost 3 years ago

Started working on it, see PoC

Actions #4

Updated by Pierre-Louis Bonicoli over 2 years ago

  • Target version changed from 0.9.3 to 0.10.0
Actions #5

Updated by Pierre-Louis Bonicoli over 2 years ago

  • Status changed from In Progress to Resolved
  • Target version changed from 0.10.0 to 0.9.3

@Loïc Gomez pointed that this one has been included in the 0.9.3 release :)

Actions

Also available in: Atom PDF