libosmo-netif[master]: src: _snprintf() helper functions nul-terminate buffers, if ...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Pau Espin Pedrol gerrit-no-reply at lists.osmocom.org
Tue Sep 12 11:58:17 UTC 2017


Patch Set 3: Code-Review+1

I think we are still not exactly fixing 1st point of commit description according to what I understand from snprintf specs. My interpretation from snprintf manual is that if an error is returned, the behavior is unexpected, meaning an implementation of snprintf which received a null-terminated buffer could return a non-null-terminated buffer when an error is returned, and thus buffer should not be used (or we should force null termination AFTER using snprintf if ret < 1). 

But as we discussed this current patch should be good enough and in practice I hope we never hit any kind of issue.

-- 
To view, visit https://gerrit.osmocom.org/3830
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I97e517f2d98e83894ea707c63489559302ff6bd2
Gerrit-PatchSet: 3
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Owner: Pablo Neira Ayuso <pablo at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pablo Neira Ayuso <pablo at gnumonks.org>
Gerrit-Reviewer: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-HasComments: No



More information about the gerrit-log mailing list